Save JPEG in fixed file size
Save JPEG in fixed file size
Hi xnview !
Do you have an option to adapt the JPEG quality automaticaly to obtain a required file size?
Or maybe do you know an algorithm able to do this with GFL functions?
Rgds
Do you have an option to adapt the JPEG quality automaticaly to obtain a required file size?
Or maybe do you know an algorithm able to do this with GFL functions?
Rgds
Dom
Re: Save JPEG fixin file size
No, perhaps by adjusting quality and compress in memorydominique wrote: Or maybe do you know an algorithm able to do this with GFL functions?
Pierre.
Save JPEG: how to see old/new file size, old/new visual qual
When i save a JPEG file, i just can specify a "Quality" (%) but i can not see the old and the new file size, as well can not see the image difference (what i would lose), can't i ?..
How to see the both old (original) / new (will be saved) file size of JPEG file?
How to see the both old (original) image / new (will be saved) image simulaneously [in two modes "Fit to half a widnow / fit to half a widnow" and "No fit / no fit (i.e. 1:1 / 1:1)"] to evaluate visual quality ?
FYI: I use Linux (X11) version of XnView unber Ubuntu Linux.
How to see the both old (original) / new (will be saved) file size of JPEG file?
How to see the both old (original) image / new (will be saved) image simulaneously [in two modes "Fit to half a widnow / fit to half a widnow" and "No fit / no fit (i.e. 1:1 / 1:1)"] to evaluate visual quality ?
FYI: I use Linux (X11) version of XnView unber Ubuntu Linux.
Re: Save JPEG in fixed file size
You should post this the XnView section of the forum 
Here is the GFLSDK forum.

Here is the GFLSDK forum.
Dom
Re: Save JPEG in fixed file size
Excuse me.dominique wrote:You should post this the XnView section of the forum
Here is the GFLSDK forum.
- iycgtptyarvg
- Posts: 81
- Joined: Wed Jan 24, 2007 3:59 pm
- Location: The Netherlands
Re: Save JPEG in fixed file size
What I do is the following:
Set the initial quality to 90% and picture size to 100%
while(pic_size > wanted_size)
quality -= 5%
picture size -= 10%
So, the iterations go like this (quality, pic size):
1. 90%, 100%
2. 85%, 90%
3. 80%, 80%
4. 75%, 70%
5. 70%, 60%
...
Of course, if you only want to change the quality settings you can simply use the halving method which has complexity O(log n).
Example:
Org size 10MB, wanted size = 500KB
1. Q100% = 7MB (initial boundary)
2. Q10% = 20KB (initial boundary)
3. Q55% = 300KB (100+10 / 2)
4. Q78% = 650KB (100+55 / 2)
5. Q67% = 520KB (55+78 / 2)
6. Q61% = 460KB (55+67 / 2)
7. Q64% = 495KB (61+67 / 2)
8. Q65% = 510KB (64+67 / 2)
Result : Q = 64
Set the initial quality to 90% and picture size to 100%
while(pic_size > wanted_size)
quality -= 5%
picture size -= 10%
So, the iterations go like this (quality, pic size):
1. 90%, 100%
2. 85%, 90%
3. 80%, 80%
4. 75%, 70%
5. 70%, 60%
...
Of course, if you only want to change the quality settings you can simply use the halving method which has complexity O(log n).
Example:
Org size 10MB, wanted size = 500KB
1. Q100% = 7MB (initial boundary)
2. Q10% = 20KB (initial boundary)
3. Q55% = 300KB (100+10 / 2)
4. Q78% = 650KB (100+55 / 2)
5. Q67% = 520KB (55+78 / 2)
6. Q61% = 460KB (55+67 / 2)
7. Q64% = 495KB (61+67 / 2)
8. Q65% = 510KB (64+67 / 2)
Result : Q = 64
(\__/)
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.