gm convert not generating images with a depth of less than 8

Ivan Hernandez-Puga <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.help
Message-ID <CAP-S4=pVjraz+w_xVQ8AkzOPA1+o7wAKJ-BS345NjfJ=+XopvA@mail.gmail.com>
Hi,

I've been comparing results between ImageMagick and GraphicsMagick in
cases where compression of PNG files were 6x less in IM and found that
GM is not using depths of less than 8, even when only 2 or 4 or 8
colors are required. Is there any way to address that?

Here I copy my GM version output.

gm version
GraphicsMagick 1.3.18 2013-03-10 Q8 http://www.GraphicsMagick.org/
Copyright (C) 2002-2013 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.

Feature Support:
  Thread Safe              yes
  Large Files (> 32 bit)   yes
  Large Memory (> 32 bit)  yes
  BZIP                     yes
  DPS                      no
  FlashPix                 no
  FreeType                 yes
  Ghostscript (Library)    no
  JBIG                     yes
  JPEG-2000                yes
  JPEG                     yes
  Little CMS               yes
  Loadable Modules         no
  OpenMP                   yes (201107)
  PNG                      yes
  TIFF                     yes
  TRIO                     no
  UMEM                     no
  WMF                      yes
  X11                      yes
  XML                      yes
  ZLIB                     yes

Host type: x86_64-pc-linux-gnu

Configured using the command:
  ./configure  '--build' 'x86_64-linux-gnu' '--enable-shared'
'--enable-static' '--enable-libtool-verbose' '--prefix=/usr'
'--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info'
'--docdir=${prefix}/share/doc/graphicsmagick'
'--with-gs-font-dir=/usr/share/fonts/type1/gsfonts' '--with-x'
'--x-includes=/usr/include/X11' '--x-libraries=/usr/lib/X11'
'--without-dps' '--without-modules' '--without-frozenpaths'
'--with-perl' '--with-perl-options=INSTALLDIRS=vendor'
'build_alias=x86_64-linux-gnu' 'CFLAGS=-Wall -g -fno-strict-aliasing
-fPIE  -fstack-protector --param ssp-buffer-size=4
-D_FORTIFY_SOURCE=2  -Wformat -Wformat-security
-Werror=format-security  -O2' 'LDFLAGS=  -fPIE -pie  -Wl,-z,relro
-Wl,-z,now ' 'CXXFLAGS=-Wall -g -fno-strict-aliasing  -fPIE
-fstack-protector --param ssp-buffer-size=4  -D_FORTIFY_SOURCE=2
-Wformat -Wformat-security -Werror=format-security  -O2'

Final Build Parameters:
  CC       = gcc -std=gnu99
  CFLAGS   = -fopenmp -Wall -g -fno-strict-aliasing -fPIE
-fstack-protector --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2
-Wformat -Wformat-security -Werror=format-security -O2 -Wall -pthread
  CPPFLAGS = -I/usr/include/X11 -I/usr/include/freetype2 -I/usr/include/libxml2
  CXX      = g++
  CXXFLAGS = -Wall -g -fno-strict-aliasing -fPIE -fstack-protector
--param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat
-Wformat-security -Werror=format-security -O2 -pthread
  LDFLAGS  = -fPIE -pie -Wl,-z,relro -Wl,-z,now -L/usr/lib/X11
-L/usr/lib -L/usr/lib
  LIBS     = -ljbig -llcms2 -ltiff -lfreetype -ljasper -ljpeg -lpng12
-lwmflite -lXext -lSM -lICE -lX11 -llzma -lbz2 -lxml2 -lz -lm -lgomp
-lpthread

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.