Image Processing?

BlitzMax Forums/BlitzMax Programming/Image Processing?

Sanctus(Posted 2008) [#1]
Hi
I'd like to write a format for sprites that stores more informations about frames, blending, animations. For that I'd like to know more about how can I read the pixels from a image and how should I write pixels to a TImage for when I load it.
My application is going pretty well but that info is vital

EDIT:
Also is it possible to have pixmaps of different sizes in a TImage?
If not I guess you I can use multiple Images but I think that's a slowdown.


tonyg(Posted 2008) [#2]
how can I read the pixels from a image

lockimage, readpixel, unlockimage
how should I write pixels to a TImage

lockimage,writepixel, unlockimage
Also is it possible to have pixmaps of different sizes in a TImage?

I've either misunderstood or you might need to check what a pixmap is again.


ImaginaryHuman(Posted 2008) [#3]
It would be much more efficient for you to read and write pixmaps and then convert the pixmap into/from an image, rather than use pixel reading and writing.


dmaz(Posted 2008) [#4]
your best bet is to store your images all in one texture or maybe a couple. that way you can have different sizes and all kinds of other things packed in there. I was headed down that path myself until I got bored :(

do a search in this forum on "single surface".


iprice(Posted 2008) [#5]
how should I write pixels to a TImage

lockimage,writepixel, unlockimage


I thought that you could only write pixels to a pixmap. I tried writing pixels to an image without success. Do you have some code to show this in action?


tonyg(Posted 2008) [#6]
I thought that you could only write pixels to a pixmap.

That is true and is why you need to lockimage to obtain access to the pixmap. This is then reflected the next time the image is drawn.


iprice(Posted 2008) [#7]
OK. I know where I went wrong now. Cheers :)