Benefits of imagecreate ?
mdb Offline
Junior Member
**
Posts: 27
Joined: May 2012
Post: #1
Benefits of imagecreate ?
Hey guys,
So on my forum I wanted to apply a grayscale filter to a few of my images. I did it using this method:

PHP Code:
$pic = imagecreatefrompng('images/spray.png');
imagefilter($pic, IMG_FILTER_GRAYSCALE);
imagesavealpha($pic, true);
imagepng($pic, 'images/spray_grayscale.png');
imagedestroy($pic);


However I noticed anytime someone views this page where that code is running, it re-saves the image everytime, overwriting the old one. Isn't this sort of pointless? Wouldn't it use a lot less resources if I just took away this code now since the image is already created and saved on my forum?

Forgive me but i'm new to this function and just used it for the first time. I'm not quite sure how it's intended to be used.

08-16-2012 06:59 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Benefits of imagecreate ? - mdb - 08-16-2012 06:59 AM
RE: Benefits of imagecreate ? - Sama34 - 08-16-2012, 08:04 AM
RE: Benefits of imagecreate ? - mdb - 08-16-2012, 02:44 PM
RE: Benefits of imagecreate ? - Sama34 - 08-17-2012, 06:23 AM
RE: Benefits of imagecreate ? - Sama34 - 08-17-2012, 10:37 AM
RE: Benefits of imagecreate ? - Sama34 - 08-17-2012, 02:25 PM
RE: Benefits of imagecreate ? - Sama34 - 08-17-2012, 04:31 PM

 Standard Tools
Forum Jump: