preferences for ImageEncoders

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

preferences for ImageEncoders

Post by Kaeru Gaman »

it would be nice to be able to set more Values when using ImageEncoders for SaveImage/SaveSprite.

e.g. for JPG:
Quality 0-100
[] progressive JPG
[] grayscale JPG
[] Disable color subsampling

maybe SetJPGEncoderPreferences(.....
oh... and have a nice day.
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post by AND51 »

Why including a new command?
I would prefer using the Flag-Parameter at SaveImage/Sprite and using constants.
PB 4.30

Code: Select all

onErrorGoto(?Fred)
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

because different Encoders have different numbers of parameters...

there are more than the above for JPG,
for PNG it's only compression 0-9 and an additional transparent color if without alpha.
oh... and have a nice day.
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post by AND51 »

I have no problem with implementing a new command (if Fred agrees with your idea).
But basically I prefer using existing commands. Maybe Fred can extend the Save-Commands like this:

Code: Select all

SaveImage(#Image, FileName$[, Flags[, Mode])
Imagine, you want to save more than 1 image at once but with different settings. Then you've got much t write:

Code: Select all

SetJPEGSettings(#PB_JPEG_Gray)
SaveImage(...)
SetJPEGSettings(#PB_JPEG_Quality, 95)
SaveImage(...)
; and so on
In my opionion, this would be a disadvantage.

I suggest to await Fred's agreement, otherwise we don't need to think about the 'how'.
PB 4.30

Code: Select all

onErrorGoto(?Fred)
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

also I can construct a scenario, where you want to save a hundred pictures with the same settings... so what? :roll:
oh... and have a nice day.
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post by AND51 »

So what? When saving images with the SAME settings you...

Just create a macro... :wink:
Or use a loop instead... :wink: :wink:
PB 4.30

Code: Select all

onErrorGoto(?Fred)
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

are you often selling the leather before the calf is born? Image
oh... and have a nice day.
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post by AND51 »

Kaeru Gaman wrote:are you often selling the leather before the calf is born? Image
No idea what to say now? :P
I wrote:I suggest to await Fred's agreement, otherwise we don't need to think about the 'how'.
:o
PB 4.30

Code: Select all

onErrorGoto(?Fred)
Post Reply