Switch to full style
If you have any suggestions for improving the manual, this is the place for that. Please reports errors, typos, difficult to understand sections, missing information, etc. Also, any short code segments that better explain a topic are welcome.
Post a reply

Quality Parameter for Jpeg Saving

Tue May 09, 2017 1:17 am

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


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

Gregor

Re: Quality Parameter for Jpeg Saving

Tue May 09, 2017 2:25 am

aFox wrote:Hadutke found a missing description about Jpeg quality.
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.

Re: Quality Parameter for Jpeg Saving

Tue May 09, 2017 3:23 pm

Hi Mike,

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....
Post a reply