Extract image in data form for image processing
Posted: 2017-11-19T06:18:35-07:00
How can i use convert or other command to extract data from my image into a required form. I will use the same data in filters and get result in exactly same manner. I will also have to convert it back to image. Are there any commands to generate pixel data (1 pixel) each line for gray scale 8bit image. For example:
0,0 56
0,1 33
0,2 98
0,3 59
.
.
.
.
1279,959 72
What I'm getting with regular command "convert image.jpg image.txt" is really bugging me. The result is something like below:
# ImageMagick pixel enumeration: 1280,960,65535,srgb
0,0: (514,514,514) #020202 srgb(2,2,2)
1,0: (6939,6939,6939) #1B1B1B srgb(27,27,27)
2,0: (10280,10280,10280) #282828 srgb(40,40,40)
3,0: (8738,8738,8738) #222222 srgb(34,34,34)
4,0: (10023,10023,10023) #272727 srgb(39,39,39)
5,0: (16962,16962,16962) #424242 grey26
6,0: (23901,23901,23901) #5D5D5D srgb(93,93,93)
7,0: (26728,26728,26728) #686868 srgb(104,104,104)
8,0: (16705,16705,16705) #414141 srgb(65,65,65)
9,0: (18761,18761,18761) #494949 srgb(73,73,73)
0,0 56
0,1 33
0,2 98
0,3 59
.
.
.
.
1279,959 72
What I'm getting with regular command "convert image.jpg image.txt" is really bugging me. The result is something like below:
# ImageMagick pixel enumeration: 1280,960,65535,srgb
0,0: (514,514,514) #020202 srgb(2,2,2)
1,0: (6939,6939,6939) #1B1B1B srgb(27,27,27)
2,0: (10280,10280,10280) #282828 srgb(40,40,40)
3,0: (8738,8738,8738) #222222 srgb(34,34,34)
4,0: (10023,10023,10023) #272727 srgb(39,39,39)
5,0: (16962,16962,16962) #424242 grey26
6,0: (23901,23901,23901) #5D5D5D srgb(93,93,93)
7,0: (26728,26728,26728) #686868 srgb(104,104,104)
8,0: (16705,16705,16705) #414141 srgb(65,65,65)
9,0: (18761,18761,18761) #494949 srgb(73,73,73)