rfobasic.freeforums.org
http://rfobasic.freeforums.org/

Quality Parameter for Jpeg Saving
http://rfobasic.freeforums.org/quality-parameter-for-jpeg-saving-t5052.html
Page 1 of 1

Author:  aFox [ Tue May 09, 2017 1:17 am ]
Post subject:  Quality Parameter for Jpeg Saving

Hadutke found a missing description about Jpeg quality.
Quote:
Gr.bitmap.save <bitmap_ptr_nvar>, <filename_sexp>{, <quality_nexp>}


<quality_nexp>
The possible range is from 0 to 100.
Default is 50.

Gregor

Author:  mjcoon [ Tue May 09, 2017 2:25 am ]
Post subject:  Re: Quality Parameter for Jpeg Saving

aFox wrote:
Hadutke found a missing description about Jpeg quality.
Quote:
Gr.bitmap.save <bitmap_ptr_nvar>, <filename_sexp>{, <quality_nexp>}


<quality_nexp>
The possible range is from 0 to 100.
Default is 50.

Gregor

I wonder what zero quality would mean... Not worth doing?

Mike.

Author:  Aat [ Tue May 09, 2017 3:23 pm ]
Post subject:  Re: Quality Parameter for Jpeg Saving

Hi Mike,

Quote:
I wonder what zero quality would mean... Not worth doing?

In Dutch we say "that was a shot in front of an open goal", hope you'll understand......

I loaded the board from my latest game (a .png) and saved it as a .jpg with quality 0......
Code:
GR.BITMAP.LOAD Bg,DataPath$+"Board.png"
GR.BITMAP.SAVE Bg,DataPath$+"Board.jpg",0

Have a look at the difference:
ImageImage

I guess the discrete cosine transfer function, used for compressing a jpg, has a minimum setting which is still more or less acceptable: The zero quality used in RFO-Basic.
If you want to see some really dramatic image deterioration try the following:
Load a simple small picture and save it as a jpg with any quality setting, e.g 50. Load the newly saved picture and save it again (same setting).
Look at the pic and repeat the process a number of times.
You will soon see the DCT treats more and more colors on a par....... :evil:
This is why I avoid jpg as much as possible!

Have fun,

Aat

[EDIT].....hope this is not too much off-topic....

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/