Image size
-
Hello, In my application I scan image (by C# code) and I save in local disc (by C# code),but problem is: the image is very large with size 1.50MB after it is saved in local disc. How can I decrease size of scaned image by C# code? Regards.
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.
-
Hello, In my application I scan image (by C# code) and I save in local disc (by C# code),but problem is: the image is very large with size 1.50MB after it is saved in local disc. How can I decrease size of scaned image by C# code? Regards.
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.
-
Hello, In my application I scan image (by C# code) and I save in local disc (by C# code),but problem is: the image is very large with size 1.50MB after it is saved in local disc. How can I decrease size of scaned image by C# code? Regards.
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.
Hi, Image.Save has many overloads, don't just use
myImage.Save(myFilename);
the file size depends on many things: - the image size in pixels (width and height); do you actually need that resolution? - the number of bits per pixel (e.g. 24 bpp); - the image format (see ImageFormat class). It all depends on what you want or need. You can reduce the number of pixels (by resampling the image), you can reduce the number of bits per pixel, or you can choose an image format with high(er) compression. Some formats have no compression, some can compress but don't do so by default, some (e.g. JPEG) perform compression and allow a choice from best quality to most compact. Another way to reduce image size is reducing the number of different colors to 256 and use an indexed image, that way it takes 1 byte per pixel. :)Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text output (not TextBoxes), and PictureBoxes for pictures (not drawings).
-
Hi, Image.Save has many overloads, don't just use
myImage.Save(myFilename);
the file size depends on many things: - the image size in pixels (width and height); do you actually need that resolution? - the number of bits per pixel (e.g. 24 bpp); - the image format (see ImageFormat class). It all depends on what you want or need. You can reduce the number of pixels (by resampling the image), you can reduce the number of bits per pixel, or you can choose an image format with high(er) compression. Some formats have no compression, some can compress but don't do so by default, some (e.g. JPEG) perform compression and allow a choice from best quality to most compact. Another way to reduce image size is reducing the number of different colors to 256 and use an indexed image, that way it takes 1 byte per pixel. :)Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text output (not TextBoxes), and PictureBoxes for pictures (not drawings).
Thank you for your answer,I figured out based on your suggestions. Finally I used ImageFormat and it works good. My best regards.
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.
-
Thank you for your answer,I figured out based on your suggestions. Finally I used ImageFormat and it works good. My best regards.
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.
You're welcome. :)
Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text output (not TextBoxes), and PictureBoxes for pictures (not drawings).