Page 1 of 1

Implement standard jpeg compression functionality

Posted: Sat Jul 18, 2015 11:54 pm
by Michael Vogel
I would like to get a better control for the compression level when saving jpeg files, the given 10% steps (1%, 10%, 20%,... 90%, 100%) results are not so perfect for photos. A typically used compression value is 97% or so. Of course, enhanced features (like color sampling, Huffman optimizing etc.) would be fine, but that's another story...

Re: Implement standard jpeg compression functionality

Posted: Sun Jul 19, 2015 2:46 pm
by blueb

Re: Implement standard jpeg compression functionality

Posted: Sun Jul 19, 2015 3:49 pm
by c4s
+1

Re: Implement standard jpeg compression functionality

Posted: Sun Jul 19, 2015 9:48 pm
by davido
+1

Re: Implement standard jpeg compression functionality

Posted: Mon Jul 20, 2015 4:56 am
by Shield
+1

I wonder if PB's currently provided functionality has been arbitrary limited for "simplicity" :?:

Re: Implement standard jpeg compression functionality

Posted: Mon Jul 20, 2015 8:58 am
by c4s
@Shield
In my opinion advanced features (such as color sampling, Huffman optimization etc.) aren't mandatory. Being able to specify the quality level from 0-100 instead of 0-10 would already be cool enough.

Re: Implement standard jpeg compression functionality

Posted: Mon Jul 20, 2015 11:09 am
by Dude
Shield wrote:I wonder if PB's currently provided functionality has been arbitrary limited for "simplicity" :?:
I doubt it. The concept of percentages is understood by everyone with a primary school education.

Re: Implement standard jpeg compression functionality

Posted: Mon Jul 20, 2015 12:06 pm
by Shield
Compressing images isn't just about setting a compression value. It usually requires several parameters to be set
in order to achieve the best possible outcome (algorithm, method, buffer sizes, ...). Depending on what libraries
are used by PB, it might very well have been easier to just implement ten pre-selected configurations.

Re: Implement standard jpeg compression functionality

Posted: Tue Jul 21, 2015 10:20 am
by Michael Vogel
blueb wrote:This might be useful... http://www.purebasic.fr/english/viewtop ... 24#p461824
Not bad, but it would be nice to do this things without the use of external programs...

Here's what I am doing actually: ShowRoom (just press 'Return' multiple times after starting the program)

Re: Implement standard jpeg compression functionality

Posted: Tue Jul 21, 2015 11:39 am
by Dude
Michael Vogel wrote:it would be nice to do this things without the use of external programs
Here you go... set the compression from 0 to 100 as you see fit:

http://www.purebasic.fr/english/viewtop ... 98#p253898

Thanks to srod. :)