php create picture

Dear Expert,

Can I produce one image that mix from many source?
Ex:
1. layer one: background image
2. layer two: people image
3. layer three: date and time input user
arkam chouAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ray PaseurCommented:
Yes.  You can use the GD library for this.  Start your learning adventures here:
http://php.net/manual/en/book.image.php
http://php.net/manual/en/ref.image.php

In PHP, one of the many uses of computer-generated images is to prepare a CAPTCHA test.  This article has some examples of image-based CAPTCHA generation.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_9849-Making-CAPTCHA-Friendlier-with-PHP-Image-Manipulation.html

This might be useful, too.
http://www.experts-exchange.com/articles/6554/Use-PHP-to-Make-an-Image-Thumbnail.html
0
Julian HansenCommented:
Depending on what your application is you can also achieve this in the client using CSS.

You can specify multiple backgrounds for an element, layer them, position them and scale them independently.

More info here

http://www.css3.info/preview/multiple-backgrounds/
0
arkam chouAuthor Commented:
sorry all that not clarify clearly. as the question, I want to produce image file that make up from many layer and text.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Julian HansenCommented:
Can you give us an example of what you are trying to achieve

- What is the application - what is this for?
- Example image of what you want to achieve.

There could be various answers to this question depending on exactly what you want to do.
0
arkam chouAuthor Commented:
I want to generate image file. I have three type of source to generate many file as below:
1. I choose many image file as layer1 (background)
2. I choose many image file as layer2 (logo image)
3. I input many date and time as layer3

ex: I input 100 difference date and time. so it will generate 100 image file by combine  random background (layer1), logo(layer2) and each input date.
0
Ray PaseurCommented:
Yes, you can do that.  But this is not really a question with any succinct answer, so much as a request for application development, and for that you may want to hire a professional developer.

I should have added this link to the articles about image processing:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_10065-Adding-a-Watermark-to-an-Image.html

If you read those three articles and still have questions, please post back and tell us specifically what you do not understand.  We'll be glad to help.
0
Julian HansenCommented:
Ok, but what do you want to do with the output?
0
Julian HansenCommented:
Without knowing how you intend to use your final image difficult to give you any direction.

Here is a simple script to demonstrate dynamically creating a composite image with overlay text by selecting different items from a radio list

http://www.marcorpsa.com/ee/t797.html
0
arkam chouAuthor Commented:
I not yet complete read link from Ray Paseur, but seeing last link of JulianH, this example is nearly complete. after overlay backgrounds, foregrounds and text, it will produce window image file.
The process of create image file is not one by one. I need to choose many backgrounds, foregrounds and list of test from excel then generate file by random backgrounds, foreground and loop with text that collect from excel.
0
Julian HansenCommented:
Are you able to proceed with the example or do you require more input from us?
0
arkam chouAuthor Commented:
for my question is require more input from you but I will try myself if I can create file from your last example.
0
Julian HansenCommented:
or my question is require more input from you
Can you be a bit more specific as to what exactly you need from us. From your second to last post you seemed to be saying the example was mostly there but did not say what was still required.
0
arkam chouAuthor Commented:
I want to create image files. The image file is mixing with three layer:
layer1: is background
layer2: is foreground
layer3: is text

the layer1 has many image in server
the layer2 has many image in server
the layer3 is input by user (it can input one by one or take list of text from excel or text file

when create image file,  it will random layer1, layer2 from server with the layer3 that input by user.
0
Julian HansenCommented:
@Sokrada - that is basically the same information you gave us at the beginning.

You have not told us what you are going to do with this image - how are your users going to view / interact with it.
Is this going to be viewed in a web page?
Do they need to download a copy or only view?

What do you still need that was not in the example posted.
0
Ray PaseurCommented:
Please show us your test data set and show us the code you've tried to use to accomplish these tasks.
0
arkam chouAuthor Commented:
create image files (download a copy)
0
Julian HansenCommented:
What will be done with the copy - is it viewed or saved.

In this comment  http://www.experts-exchange.com/Programming/Languages/Scripting/PHP/Q_28682644.html#a40805447 you said
but seeing last link of JulianH, this example is nearly complete
I have twice asked for clarification on what you still need this example to do.
0
arkam chouAuthor Commented:
because the image on this example cannot save as image file

http://www.marcorpsa.com/ee/t797.html
0
Julian HansenCommented:
Now we are finally getting somewhere.

So your requirement is to create a composite image as a .JPG (or .PNG) made up of a random selection of background, foreground and date layers (images and text).

This must be saved to a new image [WHAT NAMING CONVENTION?] which is then returned to the browser?

Is this correct?
0
arkam chouAuthor Commented:
yes. I want create new image file by mixing these three layer.
0
Julian HansenCommented:
I have updated the sample to  create an image from the selection. Whatever you select is returned as a composite image with text.

Source files are attached.

Sample here http://www.marcorpsa.com/ee/t797.html
t797.html
makeimage.php
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
arkam chouAuthor Commented:
Dear JulianH,

It alert message "Failed ...".
0
Julian HansenCommented:
It alert message "Failed ...".
@sokrada, if you want to get the best out of this forum you need to supply us with good information.

Your last post tells us nothing at all about your problem - what failed - where? There are no alert's in the sample posted.

Please can you be a bit more descriptive in your posts.
0
arkam chouAuthor Commented:
Dear JulianH,

Please help to find attachment that I combine html and php. After I click button "SaveImage", it show message "Failed..".
background.jpg
Login.png
system.png
0
Julian HansenCommented:
I have loaded those to the sample page.

Attached image was saved from that page
Saved image
0
arkam chouAuthor Commented:
Dear JulianH,

sorry forgot attach you with this code. I think may be have something with me. could you check this attachment.
saveImage.php
0
Julian HansenCommented:
That code works perfectly on my side so I would imagine that something like the font file not being in the same folder as your script file is the problem. As I mentioned in my earlier post the font file must either be referred to by its absolute path or it must be in the same folder.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.