• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Merge/overlay multiple images into a single image

[eluser]Roger Glenn[/eluser]
My client is selling lots in a neighborhood development. I have a map of the neighborhood with all the lots drawn out. When you mouse-over the map a larger version of each lot shape appears in green or red (along with other data) depending on it's availability.

This is okay, but it would be better if the lots on the master map were already colored red/green.


I have the map in a layered Fireworks file. This is the exported GIF:


I've also exported GIF's of each "lot layer" as red/green with the same dimensions and transparent backgrounds. Examples:


A control panel lets the developer update lot availability and prices, so each lot's status could change at any time.

I need the system to create a new map whenever lot availability changes.

My idea is:

1. query the database for each lot's availability
2. get the appropriate red/green "lot layer" image
3. merge/overlay it on top of the master map
4. overwrite the master map image file

I found an web article on using the GD function imagecopymerge(), but is there a way to accomplish this with CodeIgniter's image manipulation library?

Does anyone have experience creating these kinds of images on the fly?

You can specify a library in the image_lib config file. I believe that CodeIgniter supports other image libraries such as ImageMagick.

To point you in a direction where you might find some sample code unrelated to CI, you might download a copy of TYPO3 and study how they use GD/GD2 in combination with ImageMagick. In fact, one of the configuration tests they perform post install is an overlay example.

[eluser]Phil Sturgeon[/eluser]
In a situation like this its normally faster to do a quick bit of reconnaissance yourself. The only function in Image_lip.php containing imagecopymerge() is overlay_watermar() which may well do some of the work you need.

If not, use some pure PHP, make it into a plugin/helper/modified library and post it back ^_^

[eluser]Roger Glenn[/eluser]
I realized that this can be done with CI's watermark function in the Image Manipulation library.

Thanks guys.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.