Rank: Member
Groups: Guest
Joined: 1/7/2008(UTC) Posts: 28
|
Hi, I am having a code as below Code:
Dim image as new Aurigma.GraphicMill.Bitmap(WorkingBitmap)
image.Save(WorkingBitmap)
What I found is, after the "open and save" code, it reduce my file size a lot. May I know is that due to some setting that i left out ? or there is actually a better compression? or the quality has been reduced? (I check the dpi, width and height, and they seems the same value as the original file) Please advice.
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 1/31/2005(UTC) Posts: 458
Was thanked: 5 time(s) in 5 post(s)
|
Hello, It depends on the file format you have used. Theoretically, it is possible to get smaller size (and quality) of the image with such code. For example, if you load image and save it to JPEG with default compression value (75 of 100) - you will lose some quality and will get smaller file. You can place this code in a loop for a 5-20 iterations to get clearly visible degradation of the image. |
|
|
|
|
Rank: Member
Groups: Guest
Joined: 1/7/2008(UTC) Posts: 28
|
Hi, May I have the sample code to change the bitmap save/open compression?
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 1/31/2005(UTC) Posts: 458
Was thanked: 5 time(s) in 5 post(s)
|
|
|
|
|
|
Rank: Member
Groups: Guest
Joined: 1/7/2008(UTC) Posts: 28
|
Thanks for the reference. Just wondering is there anyway to keep the file size "almost" the same? or with least quality drop? bitmap.Save(_item.Pidl.Path, New Aurigma.GraphicsMill.Codecs.JpegEncoderOptions(100, False, False)) I was trying to use this code, but seems like for each iteration, it will keep increasing the file size. Please advice.
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 1/31/2005(UTC) Posts: 458
Was thanked: 5 time(s) in 5 post(s)
|
Hello, As I understand, there is no such way with JPEG (or any other lossy format). You may switch to some non-lossy format (e.g. PNG), or minimize/avoid re-saving operations if it is possible in your task (e.g. via lossless JPEG transforms). |
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.