Implement standard jpeg compression functionality

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Michael Vogel
Addict
Addict
Posts: 2797
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Implement standard jpeg compression functionality

Post 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...
User avatar
blueb
Addict
Addict
Posts: 1111
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: Implement standard jpeg compression functionality

Post by blueb »

- It was too lonely at the top.

System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Implement standard jpeg compression functionality

Post by c4s »

+1
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: Implement standard jpeg compression functionality

Post by davido »

+1
DE AA EB
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

Re: Implement standard jpeg compression functionality

Post by Shield »

+1

I wonder if PB's currently provided functionality has been arbitrary limited for "simplicity" :?:
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Implement standard jpeg compression functionality

Post 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.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: Implement standard jpeg compression functionality

Post 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.
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

Re: Implement standard jpeg compression functionality

Post 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.
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
User avatar
Michael Vogel
Addict
Addict
Posts: 2797
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Implement standard jpeg compression functionality

Post 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)
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: Implement standard jpeg compression functionality

Post 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. :)
Post Reply