Connecting Tech Pros Worldwide Help | Site Map

Image Quality problem

somequestion
Guest
 
Posts: n/a
#1: Nov 19 '05
System.Drawing.Image newImage = Bitmap(....)

newImage.Save(destinationPath, ImageFormat.Jpeg);

this image resolution is very low
i'd like to make high quality image
so i change ImageFormat.Bmp or Tiff but it too big....maybe more than 10
times of original image
my goal is
low image size and high quality....how can i do?



Ersin Gençtürk
Guest
 
Posts: n/a
#2: Nov 19 '05

re: Image Quality problem


try using ImageFormat.Png format ,
its not perfect but better then jpg and not big as bmp or tiff.

ersin


"somequestion" <somequestion@gmail.com> wrote in message
news:eN2TceN5FHA.444@TK2MSFTNGP11.phx.gbl...[color=blue]
> System.Drawing.Image newImage = Bitmap(....)
>
> newImage.Save(destinationPath, ImageFormat.Jpeg);
>
> this image resolution is very low
> i'd like to make high quality image
> so i change ImageFormat.Bmp or Tiff but it too big....maybe more than 10
> times of original image
> my goal is
> low image size and high quality....how can i do?
>
>
>[/color]


JuanCri
Guest
 
Posts: n/a
#3: Nov 19 '05

re: Image Quality problem


You can set the quality of the image:

// Create parameters
EncoderParameters params = new EncoderParameters (1);

// Set quality (50)
params.Param[0] = new EncoderParameter (Encoder.Quality, 50);

// Create encoder info
ImageCodecInfo codec = GetEncoderInfo("image/jpeg");

// Save
image.Save (filename, codec, params);



--

Juan C. Olivares
www.juancri.com

somequestion
Guest
 
Posts: n/a
#4: Nov 19 '05

re: Image Quality problem


thanks for reply

the test of result is png image created 6 times bigger than original image
i've already have tested all of ImageFormat option such as
JPEG,TIFF,BMP,EXIF and so on.
only JPEG format option make low image than original image.

i guss there is any way changing JPEG Quality. ..
for example...InterpolationMode
can i apply this method in my code ...?



System.Drawing.Image newImage newImage = new
Bitmap(targetImagePath);

newImage.Save(destinationPath, ImageFormat.Png);



"Ersin Gen??k" <ers[spam]@gencturk.org> wrote in message
news:uTntRQQ5FHA.1464@tk2msftngp13.phx.gbl...[color=blue]
> try using ImageFormat.Png format ,
> its not perfect but better then jpg and not big as bmp or tiff.
>
> ersin
>
>
> "somequestion" <somequestion@gmail.com> wrote in message
> news:eN2TceN5FHA.444@TK2MSFTNGP11.phx.gbl...[color=green]
>> System.Drawing.Image newImage = Bitmap(....)
>>
>> newImage.Save(destinationPath, ImageFormat.Jpeg);
>>
>> this image resolution is very low
>> i'd like to make high quality image
>> so i change ImageFormat.Bmp or Tiff but it too big....maybe more than 10
>> times of original image
>> my goal is
>> low image size and high quality....how can i do?
>>
>>
>>[/color]
>
>[/color]


somequestion
Guest
 
Posts: n/a
#5: Nov 19 '05

re: Image Quality problem


There is no GetEncoderInfo....


"JuanCri" <juancri@gmail.com> wrote in message
news:1131534767.785414.185280@f14g2000cwb.googlegr oups.com...[color=blue]
> You can set the quality of the image:
>
> // Create parameters
> EncoderParameters params = new EncoderParameters (1);
>
> // Set quality (50)
> params.Param[0] = new EncoderParameter (Encoder.Quality, 50);
>
> // Create encoder info
> ImageCodecInfo codec = GetEncoderInfo("image/jpeg");
>
> // Save
> image.Save (filename, codec, params);
>
>
>
> --
>
> Juan C. Olivares
> www.juancri.com
>[/color]


JuanCri
Guest
 
Posts: n/a
#6: Nov 19 '05

re: Image Quality problem


You are right... rewritten:

// Create parameters
EncoderParameters params = new EncoderParameters (1);

// Set quality (50)
params.Param[0] = new EncoderParameter (Encoder.Quality, 50);

// Create encoder info
ImageCodecInfo codec = null;
foreach (ImageCodecInfo codectemp in ImageCodecInfo.GetImageDecoders
())
if (codectemp.MimeType == "image/jpeg")
codec = codectemp;

// Check
if (codec == null)
throw new Exception ("Codec not found for image/jpeg");

// Save
image.Save (filename, codec, params);



Juan C. Olivares
www.juancri.com

Ersin Gençtürk
Guest
 
Posts: n/a
#7: Nov 19 '05

re: Image Quality problem


Juan , even if you set the image quality 99 with encoder params , qualitiy
will be still lower then png's because of the jpg encoding engine in gdi+


"JuanCri" <juancri@gmail.com> wrote in message
news:1131545120.510277.79780@g49g2000cwa.googlegro ups.com...[color=blue]
> You are right... rewritten:
>
> // Create parameters
> EncoderParameters params = new EncoderParameters (1);
>
> // Set quality (50)
> params.Param[0] = new EncoderParameter (Encoder.Quality, 50);
>
> // Create encoder info
> ImageCodecInfo codec = null;
> foreach (ImageCodecInfo codectemp in ImageCodecInfo.GetImageDecoders
> ())
> if (codectemp.MimeType == "image/jpeg")
> codec = codectemp;
>
> // Check
> if (codec == null)
> throw new Exception ("Codec not found for image/jpeg");
>
> // Save
> image.Save (filename, codec, params);
>
>
>
> Juan C. Olivares
> www.juancri.com
>[/color]


JuanCri
Guest
 
Posts: n/a
#8: Nov 19 '05

re: Image Quality problem


it will be lower than png but may be enough high for him..who knows...

Closed Thread