How to read an image to put an array?

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
2049651
Posts: 29
Joined: 2015-10-20T07:29:42-07:00
Authentication code: 1151

How to read an image to put an array?

Post by 2049651 » 2015-10-26T22:03:27-07:00

Hi.

I don't know where to start from.
I want to read image by imagemagick into array.
My_image.read("c:aaa.jpg"); at this point, there is no error.

I want to put to arrary what I had already read image data.
And I want to write file by using imagemagick library.
Here is my code.

...
master.read("c:₩₩a.jpg");

Image my_image("640x480", "white");
my_image.modifyImage();
Pixels my_pixel_cache(my_image);
PixelPacket* pixels;
int start_x = 0, start_y = 0, size_x = 640, size_y = 480;
*pixels = Color("black");
*(pixels+200) = Color("green");
my_pixel_cache.sync();

...

But I can't get array of a.jpg. How to get a.jpg image data to array to modify?

Post Reply