Hi guys and gals.
I was a bit confused when I finished the code below.
command 1:
convert -size 2x1 xc:none \
-fill 'rgb(0,0,0)' -draw 'point 0,0' \
-fill 'rgb(0,0,1)' -draw 'point 1,0' \
-colorspace rgb -depth 8 \
out.png
command 2:
convert out.png -colorspace rgb -depth 8 out.txt
actual output:
```
# ImageMagick pixel enumeration: 2,1,255,rgb
0,0: (0,0,0) #000000 rgb(0,0,0)
1,0: (0,0,0) #000000 rgb(0,0,0)
```
expected:
```
# ImageMagick pixel enumeration: 2,1,255,rgb
0,0: (0,0,0) #000000 rgb(0,0,0)
1,0: (0,0,1) #000000 rgb(0,0,1)
```
Why the outputs is not exact my expected?
Can any one help me ?
Thanks!
Ubuntu 16.04
Version: ImageMagick 6.8.9-9 Q16 x86_64 2018-09-28 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib
Writing and Reading TXT images problems
Writing and Reading TXT images problems
Last edited by ddosimg on 2019-03-19T04:36:56-07:00, edited 1 time in total.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Writing and Reading TXT images problems
What version IM, on what platform?
For the past few years, when IM creates an images, it encodes the image as non-linear sRGB. You then convert your image to linear RGB with "-colorspace RGB". This converts the very low value 1/255 to become 0/255.
For the past few years, when IM creates an images, it encodes the image as non-linear sRGB. You then convert your image to linear RGB with "-colorspace RGB". This converts the very low value 1/255 to become 0/255.
snibgo's IM pages: im.snibgo.com
Re: Writing and Reading TXT images problems
Awesome!!!
Thanks for your help.
And sorry for my carelessness, I have added the version information.
Thanks for your help.
And sorry for my carelessness, I have added the version information.
Re: Writing and Reading TXT images problems
Awesome!!!
Thanks for your help.
And sorry for my carelessness, I have added the version information.