homepage Welcome to WebmasterWorld Guest from 50.19.172.0
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
Perl script to alter an image
Replace color with alternate color
runner

10+ Year Member



 
Msg#: 4323 posted 4:52 pm on Dec 19, 2005 (gmt 0)

Does anybody know of a perl script that will take a GIF file and replace all pixels of a specified color with an alternate color?

I have some real-time images that are produced by a third party and the background is always black. I want the background to be white. So I'll have to process the image to alter the background color everytime the image is accessed.

 

carfo

5+ Year Member



 
Msg#: 4323 posted 4:08 am on Dec 20, 2005 (gmt 0)

Look at GD::Image (I think it's called) and PerlMagick (the perl stuff from Image Magick).

HTH

runner

10+ Year Member



 
Msg#: 4323 posted 3:35 pm on Dec 20, 2005 (gmt 0)

Tony Cook's perl module Imager-0.46 on cpan.org comes with a sample script that does exacly what I need. The script and associated docs are called replace_color

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved