PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon Dec 17, 2018 3:31 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: GD jpeg quality
PostPosted: Wed Sep 08, 2004 5:35 am 
Offline
Forum Newbie
User avatar

Joined: Wed Sep 08, 2004 5:23 am
Posts: 3
Location: istanbul_TR
first.. i'm sorry for bad grammer.. cause i have no dialog practise in english..
second..
do not work with jpeg files if you wanna get true colors. i'm on a new crypto algorithm that working with image files. i can't get true colors written by our code.
i am working with png files now.. and no problem..
perhaps we can save a jpeg file %100 quality and we can get true rgb colors that written by ourselves.. how can we do?

feyd | topic split from :arrow: this thread.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 08, 2004 12:57 pm 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA
[php_man]imagejpeg[/php_man] wrote:
bool imagejpeg ( resource image [, string filename [, int quality]])


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 12, 2004 10:50 pm 
Offline
Forum Commoner

Joined: Thu Sep 09, 2004 11:10 pm
Posts: 62
Location: Breckenridge, Colorado
I noticed that quality 90 sizes are much smaller than using quality 100 and the quality is usually very good. Quality 80 was okay as well but the size was less than 10% of the quality 90 image.

If you want good crisp jpeg images use quality 90.


Top
 Profile  
 
 Post subject: Re: GD jpeg quality
PostPosted: Tue Dec 21, 2004 6:45 pm 
Offline
Jedi Mod
User avatar

Joined: Tue Dec 21, 2004 6:03 pm
Posts: 5263
Location: usrlab.com
creamind wrote:
perhaps we can save a jpeg file %100 quality and we can get true rgb colors that written by ourselves.. how can we do?


If I understand the issue correctly.. the answer is that you can't. The jpeg compression algorithm messes about with the colours so that you don't end up with exactly the same colour as you specified when creating the image, even with a quality of 100. The solution? Use imagepng() instead. You'll get much larger files, but the colours will be correct. I wrote a steganography script that had the same problem.

(The article I wrote to go with the steganography script: http://www.ooer.com/index.php?section=php&id=4&page=1 )


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group