--- kihmera_morgain <[EMAIL PROTECTED]> wrote:

> I'm new to the group, so hi! Anyways, I'm just learning PHP (out of
> necessity not because I was bored). I'm helping to program a site I
> Co-Own, which is going to be a breedables pet site. So far i've run
> into very little trouble coding the site except with one aspect.
> 
> Basically I need to program a script that will take an image
> (partially transparent) and change the color or hue of that image
> based on whatever hex color code i put in.  I cannot find a way to do
> it. I've read here and there that php 5.0 has a gd library that comes
> with image manipulation functions, however my server is running php
> 4.4.1 and I cannot upgrade, so it is of little help to me. I've
> briefly looked into other coding languages trying to find the answer,
> but so far have found none. (unfortunately my server is not compatible
> with .asp.. so thats a bust)  I'm afraid I don't know enough PHP yet
> to know if there is anyway I can code this type of script with the
> version of php I have, so I was wondering if anyone had any
> suggestions or could offer me some advice in any way on how this type
> of script may be achievable.

Actually, not being able to run ASP (ie server is not running Windows) can be a
very good thing.

The GD library should be available on most versions of PHP, including 4.4.1. 
Run a script with the function call:

<?php php_info(); ?>

to see if GD is available and which version.

Since this is likely a Linux server (since it is not Windows) another
possibility is a series of command-line tools called ImageMagick which you can
access with PHP using functions like exec().  This is not simple to do but it
can be done if your host will allow both ImageMagick and exec() functions --
many do not because both could be abused.

As you will see on http://php.net/ version 4 is reaching the end of its
maintenance life.  You may want to shift to a host which will keep up with the
security updates and versions.

Are you trying to change the color which is showing through the transparent
sections?  What type of images are these?  PNG (IE is not always good with PNG
transparency), GIF (some versions of GD can't or won't touch GIF files).

Depending on what you are trying to achieve, there may be another way to
accomplish it.  Some more details and a sample link to an image and what you
want to see would help us help you.

James

Reply via email to