Hi all,
whenever i convert a png that i created with GIMP to a rgb565 format using ffmpeg, it works perfectly.
But whenever i create a PNG using the PHP - imagemagick ($image->newImage(800, 600, $pixel); , i get an error converting it to rgb565 that says :
" test.png: could not find codec parameters "
can anyone please help,
lekaleka
convert to RGB565 from different PNG files
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert to RGB565 from different PNG files
what is your exact IM command? and what version of IM and platform?
see
viewtopic.php?f=1&t=8072&p=82506&hilit= ... mat#p82506
viewtopic.php?f=2&t=17425&p=65405&hilit ... mat#p65405
see
viewtopic.php?f=1&t=8072&p=82506&hilit= ... mat#p82506
viewtopic.php?f=2&t=17425&p=65405&hilit ... mat#p65405
Re: convert to RGB565 from different PNG files
Hi,
thanks for the quick reply.
this is my command line in ffmpeg :
ffmpeg -vcodec png -i test.png -vcodec rawvideo -f rawvideo -pix_fmt rgb565 test.raw
with im i did only :
convert test.png +dither -colors 256 -define png:bit-depth=5 test1.png
thanks for the quick reply.
this is my command line in ffmpeg :
ffmpeg -vcodec png -i test.png -vcodec rawvideo -f rawvideo -pix_fmt rgb565 test.raw
with im i did only :
convert test.png +dither -colors 256 -define png:bit-depth=5 test1.png
Re: convert to RGB565 from different PNG files
i use ubuntu 12.04 64bit
imagemagick 6.7.9
with the im command i get this error:
convert: ignoring invalid defined png:bit-depth =5 @ warning/png.c/WritePNGImage/10315.
Just a gentle reminder: with converting a GIMP png file i have no problems, it is only with the png that i create with PHP imagemagick library
imagemagick 6.7.9
with the im command i get this error:
convert: ignoring invalid defined png:bit-depth =5 @ warning/png.c/WritePNGImage/10315.
Just a gentle reminder: with converting a GIMP png file i have no problems, it is only with the png that i create with PHP imagemagick library
Re: convert to RGB565 from different PNG files
Thanks fmw42,
it worked with this command :
convert test.png -ordered-dither threshold,32,64,32 color_565.png
Thanks anyways
it worked with this command :
convert test.png -ordered-dither threshold,32,64,32 color_565.png
Thanks anyways
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert to RGB565 from different PNG files
see http://www.imagemagick.org/Usage/formats/#png_write for details of PNG write controls and bit-depth. There are some caveats.
My guess is that IM write controls for PNG do not allow bit-depth of 5. Your bit depth even with 565 format is still 16 bit depth, I believe. But I am not an expert on this.
Glennrp would have to respond with comments as he is the PNG expert for IM.
My guess is that IM write controls for PNG do not allow bit-depth of 5. Your bit depth even with 565 format is still 16 bit depth, I believe. But I am not an expert on this.
Glennrp would have to respond with comments as he is the PNG expert for IM.
Re: convert to RGB565 from different PNG files
The PNG spec allows only 8 and 16 bits per sample for truecolor images, 1,2,4, or 8 for the indexes in indexed color images and 1, 2, 4, 8, or 16 for the samples in grayscale images. You can use "ordered-dither threshold" as you did to reduce the image precision to 5-6-5 but it's still written as 8-8-8 (or with 8-bit indexes, if 256 or fewer colors are present)fmw42 wrote:Glennrp would have to respond with comments as he is the PNG expert for IM.
Edit: removed comment about ordered-dither producing a 1-1-1 image; the "levels" feature of ordered-dither was added since I last worked on it.