Page 2 of 2
Re: Poor Jpg Quality - SaveImage, #PB_ImagePlugin_JPEG
Posted: Sat Dec 29, 2012 6:34 pm
by c4s
What I meant is that if the text is saved with less quality (than it is actually possible by the way!), then photos with high contrast will look
bad too.
I think PureBasic should simply switch to a better encoding algorithm similar as e.g. Photoshop does.
Edit: luis said it a little better.

Re: Poor Jpg Quality - SaveImage, #PB_ImagePlugin_JPEG
Posted: Sat Dec 29, 2012 8:12 pm
by nase09
yep - the Text 'Test-Image' is for
testing only (when saved to jpg you see that there's something wrong easily).
Originally I discovered the problem with a (more real life

) Photo.
And I'm sure there is a good solution for this. (Example: Using 'LibJPEG none chroma-subsampling (4:4:4)' when saving jpg with quality>=8), or how about an additional Flag (already mentioned by Luis) for SaveImage() e.g. #PB_Image_Subsampling_None)
I hope my 4th post in this thread helps Fred to do what has to be done.
Re: Poor Jpg Quality - SaveImage, #PB_ImagePlugin_JPEG
Posted: Sun Dec 30, 2012 8:09 am
by MachineCode
luis wrote:For example a photographic image of a beautiful sunset with a road sign in the image.
Oooh, good comeback.

I have no argument now.

Re: Poor Jpg Quality - SaveImage, #PB_ImagePlugin_JPEG
Posted: Sun Dec 30, 2012 8:05 pm
by nase09
MachineCode wrote:Oooh, good comeback.

I have no argument now.

Some time ago there was a strange guy called Maya.
He developed a handy little calendar-tool, able to calculate Doomsday (and it shows all years statutory holidays, too!).
Of course he used Purebasic.
Unfortunately he saved the calendar's output as jpg to mail it to my aunt's daughter. The poor little girly was pretty upset: "Doomsday is 21.12.2012!!".
I said to her "wait a minute, this jpg looks strange - pretty crabbed.. are you sure this is a '1' .. this jpg contains text - it should have been saved as PNG!".
But too late. The last few weeks were terrible. My aunt's daughter almost got mad - told all of her friends to prepare for the end, and my mother (and even my neighbor's cat!) almost got mental breakdown, and my grandpa didn't stop yelling "WE'RE ALL GONNA DIEEE!!"..
(But seriously: most people here know the benefits of the different image formats. But e.g. sometimes you're limited to one single file format (jpg), and e.g. sometimes saving as PNG is no option (cause png support is pretty rare). The jpeg format CAN deliver excellent quality - so why not using it)
Re: Poor Jpg Quality - SaveImage, #PB_ImagePlugin_JPEG
Posted: Sun Dec 30, 2012 11:04 pm
by djes
nase09 wrote:MachineCode wrote:Oooh, good comeback.

I have no argument now.

Some time ago there was a strange guy called Maya.
He developed a handy little calendar-tool, able to calculate Doomsday (and it shows all years statutory holidays, too!).
Of course he used Purebasic.
Unfortunately he saved the calendar's output as jpg to mail it to my aunt's daughter. The poor little girly was pretty upset: "Doomsday is 21.12.2012!!".
I said to her "wait a minute, this jpg looks strange - pretty crabbed.. are you sure this is a '1' .. this jpg contains text - it should have been saved as PNG!".
But too late. The last few weeks were terrible. My aunt's daughter almost got mad - told all of her friends to prepare for the end, and my mother (and even my neighbor's cat!) almost got mental breakdown, and my grandpa didn't stop yelling "WE'RE ALL GONNA DIEEE!!"..
(But seriously: most people here know the benefits of the different image formats. But e.g. sometimes you're limited to one single file format (jpg), and e.g. sometimes saving as PNG is no option (cause png support is pretty rare). The jpeg format CAN deliver excellent quality - so why not using it)

Re: Poor Jpg Quality - SaveImage, #PB_ImagePlugin_JPEG
Posted: Sat Feb 16, 2013 11:23 pm
by nase09
Fred wrote:We use standard libjpeg so I don't know why the results are bad.
Dear Fred, thank you for the improvements in v5.10.
But I'm a little disappointed, cause I really need accurate jpeg output.
You didnt answer my message, I'm sure you're too busy, but now after release of 5.10 final..
please check it out - as mentioned .."Using LibJPEG none chroma-subsampling (4:4:4)" should solve the problem.
(Or am I missing something ?)
Image output is a pretty important feature, I hope "We use standard libjpeg so I don't know why the results are bad." is not your final word.
Re: Poor Jpg Quality - SaveImage, #PB_ImagePlugin_JPEG
Posted: Tue Feb 19, 2013 5:40 pm
by Thorium
You may be better of using libjpeg directly yourself. Image saving in PB isnt very great. It's ok, but if you need something fancy you need to go deeper. Same goes for PNG. Naturally you dont have a quallity lose in PNG, but PNG's saved with PB are much bigger than saved with other software because PB does not utilize the PNG filters.
Re: Poor Jpg Quality - SaveImage, #PB_ImagePlugin_JPEG
Posted: Fri Mar 08, 2013 3:04 am
by nase09
Thorium wrote:You may be better of using libjpeg directly yourself. Image saving in PB isnt very great. It's ok, but if you need something fancy you need to go deeper. Same goes for PNG. Naturally you dont have a quallity lose in PNG, but PNG's saved with PB are much bigger than saved with other software because PB does not utilize the PNG filters.
ok, this would be a workaround.. but very unconvenient..
I still hope for added SaveImage-functionality in Purebasic. (Regarding jpegs, and yes, what an excellent opportunity to set one's hand to the PNG-sector as well

)
Re: Poor Jpg Quality - SaveImage, #PB_ImagePlugin_JPEG
Posted: Mon Jul 29, 2013 8:01 pm
by Michael Vogel
There's a great difference (in size and quality) between the available quality levels, ia there any chance to get a better granularity (percents) for the jpeg quality parameter?
It's not a big deal to adapt old/new code to work with all compiler versions...
Code: Select all
; Example to adapt old source code...
CompilerIf #PB_Compiler_Version<520
#JPEGQualityFactor=1
CompilerElse
#JPEGQualityFactor=10
CompilerEndif
SaveImage(...,quality*#JPEGQualityFactor)