Click to See Complete Forum and Search --> : Image Processing and OpenGL


evan18h
11-03-2004, 12:45 AM
I need to know if I can benifit from learning opengl (c / c++ programming) if all I want to do is image/graphics processing (ex: edge detection, basic tweeking of size/rotation/skew, etc) or would it be a bad idea...do you know of any better APIs I can work from for this task?
I was figuring opengl because I know that it is good with graphics processing* and it is portable*.

*(correct me if I am wrong)

Weedpacket
11-03-2004, 05:54 AM
Not OpenGL; OpenGL isn't really suited for pixel-level operations which are what you're describing (it's more an object modelling library than one for image processing).

You might learn a bit from having a look at the Gimp's source code. You'd find that most such operations are really just a matter of having a big array of pixel structs and applying various mathematical operations to the data it contains. Lots of double-nested loops (for each row in the image, for each pixel in the row...).

Edit: I also just thought of PIL (http://www.pythonware.com/products/pil). It's written mainly in Python (porting it to PHP could be fun) with a bitmap-manipulation core written in C.

Edit 2 (http://www.acm.org/tog/GraphicsGems/)

Mordecai
11-09-2004, 01:11 PM
You may also benefit from looking at PHP5's source for bundled GD. The PHP function image_filter() handles some pretty nifty stuff.