Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
undead80  
#1 Posted : Sunday, February 17, 2008 1:09:35 AM(UTC)
undead80

Rank: Member

Groups: Member
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.

Alex Kon  
#2 Posted : Sunday, February 17, 2008 2:30:17 PM(UTC)
Alex Kon

Rank: Advanced Member

Groups: Member
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.

undead80  
#3 Posted : Sunday, February 17, 2008 6:21:16 PM(UTC)
undead80

Rank: Member

Groups: Member
Joined: 1/7/2008(UTC)
Posts: 28

Hi,

May I have the sample code to change the bitmap save/open compression?

Alex Kon  
#4 Posted : Monday, February 18, 2008 3:25:56 PM(UTC)
Alex Kon

Rank: Advanced Member

Groups: Member
Joined: 1/31/2005(UTC)
Posts: 458

Was thanked: 5 time(s) in 5 post(s)
Hello,

You can find detailed description and some code samples in this article: Understanding of JPEG Encoding Parameters.

Edited by user Tuesday, October 28, 2008 8:28:32 PM(UTC)  | Reason: Not specified

undead80  
#5 Posted : Tuesday, February 19, 2008 1:05:28 AM(UTC)
undead80

Rank: Member

Groups: Member
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.

Alex Kon  
#6 Posted : Tuesday, February 19, 2008 8:24:36 PM(UTC)
Alex Kon

Rank: Advanced Member

Groups: Member
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).

Users browsing this topic
Guest
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.