473,396 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Image Quality problem

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?

Nov 19 '05 #1
7 2187
try using ImageFormat.Png format ,
its not perfect but better then jpg and not big as bmp or tiff.

ersin
"somequestion" <so**********@gmail.com> wrote in message
news:eN*************@TK2MSFTNGP11.phx.gbl...
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?

Nov 19 '05 #2
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

Nov 19 '05 #3
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:uT**************@tk2msftngp13.phx.gbl...
try using ImageFormat.Png format ,
its not perfect but better then jpg and not big as bmp or tiff.

ersin
"somequestion" <so**********@gmail.com> wrote in message
news:eN*************@TK2MSFTNGP11.phx.gbl...
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?


Nov 19 '05 #4
There is no GetEncoderInfo....
"JuanCri" <ju*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
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

Nov 19 '05 #5
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

Nov 19 '05 #6
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" <ju*****@gmail.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
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

Nov 19 '05 #7
it will be lower than png but may be enough high for him..who knows...

Nov 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Travis | last post by:
Hi everyone, I'm using the System.Drawing.Imaging.Bitmap to retrieve and modify the metadata tags (user comments, keywords etc) of JPEGS. I was wondering if changing these tags in any way...
5
by: Popoxinhxan | last post by:
HI guy I am working on the web application that required to display the chart image on the page. The process is clicking the button and browser will popup another windows that displayed...
6
by: Chris D | last post by:
Hi, I have an application where a user uploads an image and I create two thumbnails. One a small image and the second is a larger image but still smaller then the original. I store these in SQL...
6
by: neverstill | last post by:
hi- So I wrote this nice little page that will allow the managers to add images to the products table. Without too many details to confuse everything, basically what I'm doing is: getting an...
4
by: Steve Peterson | last post by:
Hi I've been beating my head against the wall trying to get this done, with little to no success so I thought I would turn to the .Net community for some help. I have an .NET app in which the...
4
by: Greg | last post by:
I've searched everywhere for a solution Microsoft .NET Framework V 2.0.50727 AutoEventWireup="false" image2.aspx resize an image on the fly but Page_Load is triggered twice: Any suggestion?...
8
by: berkshire | last post by:
Hi, Anyone know of a script out there that can resize images and not sacrifice image quality? I've been using phpthumb (http://phpthumb.sourceforge.net/) but when compared to an image resized...
9
by: kombu67 | last post by:
I'm reading a series of images from a MS SQL table and saving them to directory. These are staff ID pictures from our security card app. Once I've extracted the ID photo from the security app to...
1
by: Sinan Alkan | last post by:
Hi All, I have a method to resize any image file to the specific dimensions and save this new image to a path. I found it on a web page(By Joel Neubeck) and i changed it for my project. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.