Jump to content

Filling an area with an image


PhaZZed

Recommended Posts

Greetings all,

 

Yesterday I got some text -> image code working, which basically takes a text value and converts it to an image with a font of choice, the example may be viewed here.. http://www.trafficmagic.co.uk/glitter/glitter.php - now what I would like to do, is fill the black areas (ie. the font) with another image, here's an example: http://www.imod.co.za/glitter.gif..

 

Any help would be greatly appreciated..

Link to comment
Share on other sites

Hmm, thats an interesting one. It would seem to me that the font layer would need to be rasterised, made transparent, masked, then the other image placed underneath it. However, how you achieve this using php/GD2 i don't have the foggiest. Hopefully my comments will spark some research off for yourself.

Link to comment
Share on other sites

would this not be done by  javascript or css?

 

Probably not CSS because that text is not actually text in this case it's a .gif image.

 

-----

 

PhaZZed: On that glitter text site they always have white stars flying around in them; however if you change the font color to white there are no stars. :o

 

My guessing is that they have used layers. A layer than constantly has the flying stars in it, and a layer on top hiding it that makes transparent shapes of the letters; thus showing the underneath layer on only the points of the letters... It's the colour of the bottom layer that changes thus does not show up white... That's a theory anyway... as to how do it? I have no idea. :P I could probably work something out but it'd take a while.

 

Sam

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.