问题
Using PHP is it possible to take an existing image and produce a copy where the original image changes from 100% opaque to 0% opaque (or 0% transparent to 100% transparent!)?
Thanks,
Toby
EDIT: I realise my question was unclear, apologies. I want to take an image and create an opacity gradient across it, so the image is 100% opaque at the top, 100% transparent at the bottom and translucent in between.
回答1:
If you change from 100% opaque to 0% opaque the image wouldn't be visible anymore. What do you want to do exactly? Change The whole Image or only a part? I would consider of using CSS (maybe + javascript) where you are able to set the transparency between 0% and 100%.
回答2:
Well if you take an image from 100% to 0%, it disappears right ? and 0% to 100% means it was transparent so it went black? I'm not sure exactly what you are asking bu try this tutorial
来源:https://stackoverflow.com/questions/4136152/php-generate-transparency-or-opacity-gradient-using-image