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

#1
[eluser]Roger Glenn[/eluser]
PROBLEM
----------------
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.

http://www.oaksofwindcrest.com/community...ble/phase1



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

http://www.oaksofwindcrest.com/images/pl...parent.gif

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

http://www.oaksofwindcrest.com/images/pl..._avail.gif
http://www.oaksofwindcrest.com/images/pl...3_sold.gif



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



SOLUTION?
----------------
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



HELP
----------------
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?

#2
[eluser]esra[/eluser]
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.

#3
[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 ^_^

#4
[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.