0

I need advice - what technology I could use to create website form to merge 2 images [take from list] and one text from text field? I want to see results on same page.

DekeR
  • 55
  • 8

1 Answers1

1

I see two possible solutions.

First, using pure javascript and canvas: I saw simillar problems here and here.

Authors use pure javascript and DOM to manipulate with html5 Canvas. So problem is to draw images on context, and also insert text. To insert text, there is method fillText, i am not sure it would look great for first time, but studying canvas should solve problem.

So HTML5 Canvas is first answer.

pros:

  • easy to implement and only javascript

cons:

  • may not fit your needs as application grows up.

Second, according to fact, that there may be some limitations, eg.

  • your picture must be on same domain as your application
  • you want to do something more difficult with images and text

then you may use server side application, and work with server side graphic library.

It may be for example PHP GD, for php.

Here is possible solution in php. The application may look like:

  • obtaining data with a form ( uploading images from disc, filling textfield )
  • after clicking submit, do an AJAX POST call with multipart-form-data to php page
  • receive an resulting image in ajax response.

pros:

  • can solve more difficult tasks, for which your application may
    evolve.

cons:

  • there are two languages to learn - php and javascript.

  • it may be difficult to send two images to php script at one time and text, but it's possible

The first solution is less complicated and you can test code adhoc, but second solution is more demanding, but you can reach better result and have more robust technology.

Community
  • 1
  • 1
changtung
  • 1,614
  • 15
  • 19