I'm working on a small project that involves modifying a Wordpress plugin to suit our specific needs. The code for the plugin is not organized very well (not as well as I have seen other plugins), nor is it documented, and after asking the developer for help (offering to pay) he said that what I needed was not possible. However, I am a firm believer that anything is possible with good programming! So please experts, can you tell me if this is possible or not...
Right now, the script allows you to change the color of the text and PNG or SVG images by selecting it and clicking on the color to change it. Easy enough. However, I want to be able to not only change the color of the text and the PNG images, but overlay them with a texture or image. In the backend, you can specify which colors are available to the end user. I want to be able to also upload textures to be available to the end user as well... at least specify them programmatically somehow.
I thought this would be possible with CSS, but I could not find any examples of it in searching Google. If there is a code snippet somewhere that demonstrates this that would be great. Any help is appreciated!
You have two options.
1. You can use html and css
Method 1
container with style position: relative
two images in the container with position: absolute;
z-index on the image stacks them
Top image is PNG - bottom can be anything
You get an overlay effect
Method 2
Container has image 1 as a background
img 2 is contained in the container
2. Backend merge of png files
Using GD2 library
Example from here imagecreatefrompng
<?php// Create image instances$dest = imagecreatefromgif('php.gif');$src = imagecreatefromgif('php.gif');// Copy and mergeimagecopymerge($dest, $src, 10, 10, 0, 0, 100, 47, 75);// Output and free from memoryheader('Content-Type: image/gif');imagegif($dest);imagedestroy($dest);imagedestroy($src);?>
Many of the PHP GD2 library functions include the ability to work with an alpha channel for transparency support, eg: ImageColorAllocateAlpha(). We have an article with an example of its use to add a semi-transparent watermark. Look for "demo/watermark_hotlinked_image.php" in the last code snippet.
greetings Carolyn, , , I have read what you want to do, and you have several things that are dependent on one another as -
"want to be able to also upload textures"
"have images and overlay them with a texture or image"
"specify them programmatically"
AND, you say you need to alter an existing WP plug-in, that is used to -
"add text to an image"
"change the color of the text"
Although I do feel that this can be done, I do not see enough information , especially about the plug-in , to know what the final "Display" (text and images I guess) , may look like for what you need, much less how or what to do to get that result. It would be helpful if the "Code" work for the plug-in was available, and some image or description of the placement and the "Effect" (layered or blending ) of what you call - "overlay them with a texture".
0
CarolynAuthor Commented:
Thank you all for the snippets and encouragement here. I've been browsing the code looking for the right spot to test these functions. But it is so badly organized that I've had to go through it file by file (the plugin installs in the root of Wordpress!) So as soon as I get a grasp on the authors "structure" I can dig in. So I'll definitely post a new question once I get to it.
The author has made developer "add-on" documentation as well, but it's very vague and his/her first language is not English, so communicating is not working and I'm going to do my best to figure it out.
Thanks again!
0
Question has a verified solution.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.
One of a set of tools we're offering as a way to say thank you for being a part of the community.
1. You can use html and css
Method 1
container with style position: relative
two images in the container with position: absolute;
z-index on the image stacks them
Top image is PNG - bottom can be anything
You get an overlay effect
Method 2
Container has image 1 as a background
img 2 is contained in the container
2. Backend merge of png files
Using GD2 library
Example from here imagecreatefrompng
Open in new window
Additional referencesimagecopymerge
imagepng