Hi.
I'm trying to convert a rgba to png file.
While there is no image size information into the rbga file, I have to give the information to convert.
I know my image resolution. it is a 256*256 images
my rgba image file size is exactly (256 *256 * 4 bytes)
I've tryed
convert -size 256x256 img.rgba img.png
I've then 2 problem.
First, I have this warning "convert: unexpected end-of-file `img.rgba': @ error/rgb.c/ReadRGBImage/232."
Second, Imagemagick made a png file, but the image is not correct.
I wonder if it's not a color depth problem !!!
"must specify image size" while convert rgba to png
Re: "must specify image size" while convert rgba to png
Founded.
It was effectively due to the pixel deph
convert -size 256x256 -depth 8 img.rgba img.png
had solve my problem.
It was effectively due to the pixel deph
convert -size 256x256 -depth 8 img.rgba img.png
had solve my problem.
Re: "must specify image size" while convert rgba to png
Right, the default depth for RGBA images is the quantum depth (Q8 or Q16) of your ImageMagick.
As you found,you can use the -depth option to override that.
As you found,you can use the -depth option to override that.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: "must specify image size" while convert rgba to png
For -depth 16 you may also need to specify -endian for the integer byte order used.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/