Image manipulation in PHP?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Image manipulation in PHP?

MentoxT
Hello everybody.  I just started learning haxe.  I started because I wanted to find a Linux alternative to the Flash IDE, and I'm really intrigued by the concept of a multiplatform language.  It seems to cover all platforms I'm interested in developing for.

I've worked with AS3 and experimented with C++ and PHP somewhat, but I'm not a professional programmer of any sort.  For that reason, it may be more difficult for me to pick up this language than it would be for others with more experience.  You can expect plenty of noob questions from me.  :P

My question today is are there any libraries or anything that allow you to dynamically create and manipulate PHP images the way PHP: GD does?  I know there's a hxGD library, but that seems to be for the Neko platform, not PHP.

If not, I suppose it would be a relatively simple matter to make a library wrapping PHP: GD, but would that be the best approach?  Is there some way to do it that wouldn't require PHP: GD to be installed on the server?  I don't know anything about Neko, is that a better option for web images?

And while I'm here, do you think it will be worthwhile to pick up Professional haXe and Neko (Programmer to Programmer), by McColl-Sylvester  and Ponticelli?  I'd like to have a printed reference, but it seems a little out of date.

Thanks in advance for any help or advice.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Image manipulation in PHP?

Heinz Hölzer-2
Here is a Haxe/PHP/GD Project that wraps the native php calls:

http://code.google.com/p/hxphp/

best,
h

Am 14.06.2010 22:39, schrieb [hidden email]
Hello everybody.  I just started learning haxe.  I started because I wanted to find a Linux alternative to the Flash IDE, and I'm really intrigued by the concept of a multiplatform language.  It seems to cover all platforms I'm interested in developing for.

I've worked with AS3 and experimented with C++ and PHP somewhat, but I'm not a professional programmer of any sort.  For that reason, it may be more difficult for me to pick up this language than it would be for others with more experience.  You can expect plenty of noob questions from me.  :P

My question today is are there any libraries or anything that allow you to dynamically create and manipulate PHP images the way PHP: GD does?  I know there's a hxGD library, but that seems to be for the Neko platform, not PHP.

If not, I suppose it would be a relatively simple matter to make a library wrapping PHP: GD, but would that be the best approach?  Is there some way to do it that wouldn't require PHP: GD to be installed on the server?  I don't know anything about Neko, is that a better option for web images?

And while I'm here, do you think it will be worthwhile to pick up Professional haXe and Neko (Programmer to Programmer), by McColl-Sylvester  and Ponticelli?  I'd like to have a printed reference, but it seems a little out of date.

Thanks in advance for any help or advice.


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Image manipulation in PHP?

MentoxT
In reply to this post by MentoxT
Thanks, I'll keep an eye on it, but it doesn't seem ready yet.  I'd still like to explore alternatives.

I've never used a mailing list before, how do I make sure my messages end up in the right thread?

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Image manipulation in PHP?

Heinz Hölzer-2
Hi,

if you subscribe to a mailing list in thunderbird there should be a button like "answer list" or
something like that.

best,
h

Am 14.06.2010 23:03, schrieb [hidden email]
Thanks, I'll keep an eye on it, but it doesn't seem ready yet.  I'd still like to explore alternatives.

I've never used a mailing list before, how do I make sure my messages end up in the right thread?


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Image manipulation in PHP?

Baluta Cristian
On gmail there's the button reply.

2010/6/15 Heinz Hölzer <[hidden email]>
Hi,

if you subscribe to a mailing list in thunderbird there should be a button like "answer list" or
something like that.

best,
h

Am 14.06.2010 23:03, schrieb [hidden email]
Thanks, I'll keep an eye on it, but it doesn't seem ready yet.  I'd still like to explore alternatives.

I've never used a mailing list before, how do I make sure my messages end up in the right thread?


--
haXe - an open source web programming language
http://haxe.org



--
Băluță Cristian
http://ralcr.com
http://imagin.ro

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Image manipulation in PHP?

Tony Polinelli
in the hxphp repo the main GD wrapping is:


This just wraps the GD functions that are available in the php distrobution. There isnt anything more to add, so nothing that can make it more 'ready' to use. I experimented with making an object oriented way of manipulating images, that is in the oo folder, this was before i realized that this is covered by the gd project in haxelib. 

If you want full gd functionality, just use the externs file tho. 

I hoped that the hxphp repo would wrap more of the standard php libs, but i havent needed to add any more as yet. 

cheers




On Tue, Jun 15, 2010 at 2:03 PM, Baluta Cristian <[hidden email]> wrote:
On gmail there's the button reply.

2010/6/15 Heinz Hölzer <[hidden email]>
Hi,

if you subscribe to a mailing list in thunderbird there should be a button like "answer list" or
something like that.

best,
h

Am 14.06.2010 23:03, schrieb [hidden email]
Thanks, I'll keep an eye on it, but it doesn't seem ready yet.  I'd still like to explore alternatives.

I've never used a mailing list before, how do I make sure my messages end up in the right thread?


--
haXe - an open source web programming language
http://haxe.org



--
Băluță Cristian
http://ralcr.com
http://imagin.ro

--
haXe - an open source web programming language
http://haxe.org



--
Tony Polinelli
http://touchmypixel.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Image manipulation in PHP?

clemos
In reply to this post by MentoxT
Hi mentox

On Mon, Jun 14, 2010 at 10:39 PM,  <[hidden email]> wrote:

[snip]

> My question today is are there any libraries or anything that allow you to
> dynamically create and manipulate PHP images the way PHP: GD does?  I know
> there's a hxGD library, but that seems to be for the Neko platform, not PHP.
>
> If not, I suppose it would be a relatively simple matter to make a library
> wrapping PHP: GD, but would that be the best approach?  Is there some way to
> do it that wouldn't require PHP: GD to be installed on the server?  I don't
> know anything about Neko, is that a better option for web images?

If you don't have GD or ImageMagick installed on your server, you can
always give hxformat a try :
http://code.google.com/p/hxformat/
It's a cross-platform library that will allow you to create/edit/save
png, jpeg, bmp files (among others).
Depending on the kind of manipulation you want to achieve, it may be
an alternative.
There are two main problems, though :
- You can only do pixel-level manipulation, there are no built-in
effects or tranformation functions
- On PHP platform, it's really slower than GD or ImageMagick
The advantage is that you may compile your program to other platforms:
I made a little image manipulation program close to PixelBender I
compiled to haXe/C++ and with the appropriate optimization, it ran
fast enough for my needs. You can even try to run this kind of program
on the client-side, in Javascript or Flash :)
It may work for simple image generation / manipulation, but if you
want to add text, effects, compositing and so on it's certainly too
limited.

Hope it helps
+++++++
Clément

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Image manipulation in PHP?

basvanmeurs
In reply to this post by MentoxT
Do you know Image Magick Convert command-line tool? This is a stand-alone tool which requires some knowledge to work with, but it's very easy to use from Haxe (any target). I also believe it is much faster than gdlib and has more features. You can easily use this tool using popen; just use Haxe Magic functions (such as __php__) and write a little wrapper class. I've recently done the same and it works great for me.

Good luck!