i was looking through some old C functions (i am planning to write them in python) and one of them stood out as needing some more python knowledge

this function takes a 2D array pixels in RGB and produces a 16777216 color GIF file

i may have to implement this for python as a C function

but what i really need to know is how python programmers store their images in memory while working with them

can someone tell me or point me to documentation?
oh, and, yes GIF really can do 24-bit color

but many program can't handle them.

(Nov-05-2016, 08:49 AM)Skaperen Wrote: [ -> ] but what i really need to know is how python programmers store their images in memory while working with them
Well if you are doing stuff that borders on computer vision then generally we use numpy arrays. The OpenCV library is the way to go if doing anything complicated (note the format is BGR annoyingly).
Really depends what you are doing. Pillow might be enough or even Pygame, but if you are doing heavy image manipulation, numpy (and numpy back libraries) are the way to go.
(Nov-05-2016, 09:12 AM)Mekire Wrote: [ -> ] (Nov-05-2016, 08:49 AM)Skaperen Wrote: [ -> ] but what i really need to know is how python programmers store their images in memory while working with them
Well if you are doing stuff that borders on computer vision then generally we use numpy arrays. The OpenCV library is the way to go if doing anything complicated (note the format is BGR annoyingly).
Really depends what you are doing. Pillow might be enough or even Pygame, but if you are doing heavy image manipulation, numpy (and numpy back libraries) are the way to go.
I will mention
Pillow. It's a 3th party library which is designed for an image processing.
so basically, if you had a task to insert some pixels in an image file, you might implement it as loading/converting that file to pixels using pillow, modify the pixels, then dump/covert it back to a file of the same format using pillow?
suppose you had 2 image processing programs (in python) running at the same time an one needs to transfer an image to the other over an existing TCP connection (these programs might be running on separate computers). what format might you send the image in? (suppose security is good enough to trust pickle). can a pillow Image object be pickled?
TCP can transfer binary data, right? I don't know for Pillow but native Python can handle this. If not, there are twisted, requests, pyzmq. For example.
asking if the goal is image embedded encryption
If the image goes to the network or some data, no matter where it goes, it has to be encrypted.
asking skaperen 'if the goal is image embedded encryption '