LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - News > Syndicated Linux News
User Name
Password
Syndicated Linux News This forum is for the discussion of Syndicated Linux News stories.

Notices


Reply
  Search this Thread
Old 07-23-2010, 12:00 PM   #1
LXer
LXer NewsBot
 
Registered: Dec 2005
Posts: 128,360

Rep: Reputation: 118Reputation: 118
LXer: Resizing images with correct gamma using PHP and GD


Published at LXer:

A short while ago "Ty W" posted an interesting question on StackOverflow. Apparently, most graphics software cannot scale images the right way. Usually it's hard to notice the flaw but the linked article does a great job of explaining the problem. PHP's GD library suffers from the same issue, but Ty discovered that the sample PHP program provided with the article did not work on partially transparent images. After a couple of hours of fiddling I managed to get a working solution. Apparently, the imagegammacorrect() function in PHP deals badly with images that have an alpha channel. I suspect that it tries to apply the same calculation to the alpha channel that it applies to the red, green and blue channels. To work around this, my solution splits the aplha channel from the original image. The alpha channel is resampled regularly while the red, green and blue channels are resampled using gamma correction.

Read More...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Making sure you have the correct PHP class or function LXer Syndicated Linux News 0 06-24-2009 08:00 AM
Bulk resizing of images? Chriswaterguy Linux - Software 7 10-07-2007 02:31 PM
LXer: Paint 3-D images with PHP LXer Syndicated Linux News 0 04-07-2006 11:54 PM
Resizing Images in the GIMP batgranny Linux - Software 1 02-15-2005 10:38 AM
Resizing images quickly? BaltikaTroika Linux - Software 12 10-23-2004 05:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - News > Syndicated Linux News

All times are GMT -5. The time now is 06:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration