GraphicsMagick support for bpg please.
Swiss army knife of image processing
Brought to you by:
bfriesen
Hi
I have libbpg with bpgdec decoder installed on my Linux system.
With ImageMagick it seems to use bpgdec with the delegates configuration ...
Like this...
~ $ display -verbose 003.bpg
'bpgdec' -b 16 -o '/tmp/magick-hNezXAXI6ttnT3WKWG08ZILyCG3TdjUS.png' '/tmp/magick-sViswqOUFZW_kHCiNiXVN31EFmaeKV8u'; /bin/mv '/tmp/magick-hNezXAXI6ttnT3WKWG08ZILyCG3TdjUS.png' '/tmp/magick-hNezXAXI6ttnT3WKWG08ZILyCG3TdjUS'
003.bpg PNG 1436x730 1436x730+0+0 16-bit sRGB 2.17652MiB 0.100u 0:00.090
But with GraphicsMagick it doesn't work...
Like this...
~ $ gm display -verbose 003.bpg
gm display: No decode delegate for this image format (003.bpg).
Untitled=>LOGO GIF 654x418+0+0 PseudoClass 128c 8-bit 21.6Ki 0.000u 0m:0.002669s (97.7Mi pixels/s)
I realize there isn't much demand for bpg support, but could GraphicsMagick be told to use bpgdec same as ImageMagick does?
PS
ImageMagick also uses bpgenc to write...
Like this...
~ $ convert -verbose foo.jpg foo.bpg
foo.jpg JPEG 640x427 640x427+0+0 8-bit sRGB 131199B 0.010u 0:00.024
foo.jpg=>/tmp/magick-sv7b0PUoqXJHIFegq1SV2UWXR4gpDCeQ PNG 640x427 640x427+0+0 8-bit sRGB 131199B 0.100u 0:00.100
'bpgenc' -b 12 -q '10' -o '/tmp/magick-i9ypSvCCOwqf2JCxdhYVBSarrvUIPQHt' '/tmp/magick-U4qvLQuaOiYOivHB5YtU2-xRACZv5Tt7'
foo.jpg=>foo.bpg PNG 640x427 640x427+0+0 8-bit sRGB 131199B 0.000u 0:01.138

On Wed, 1 Jun 2022, bat wrote:
I have not heard of this format before. It it is read via an external
delegate (as ImageMagick apparently does) then support could be added
by editing the text file 'delegates.mgk'. If this works for you, then
please send us the tested 'delegates.mgk' additions.
Bob
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt
Hi
There is a similar document here ---> https://imagemagick.org/source/delegates.xml
I think it's this file to be edited
GraphicsMagick-1.4.020220529/config/delegates.mgk
Add these two lines to delegates.mgk underneath "<delegatemap>"</delegatemap>
Then ./configure.
But it's not working for me.
I've attached the modified file, maybe I did something wrong.
Here it is
On Wed, 1 Jun 2022, bat wrote:
Make sure that your configuration was loaded appropriately by doing
'gm convert -list delegates'
If there is no line output for 'bpg' then something is wrong.
Bob
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt
Hi
In the delegates.mkg.in file there are strange entries like this...
~~~
command='"@DCRAWDecodeDelegate@"
"@BrowseDelegate@
~~~"
I only want to add a line somewhere that looks similar to this from IM...
<delegate decode="bpg" command="" bpgdec"="" -b="" 16="" -o="" "%o.png"="" "%i";="" usr="" bin="" mv="" "%o""=""></delegate>
Is that IM line the correct format to add to GM's delegates.mkg.in file?
Maybe you could edit a delegates.mkg.in file for me to try because I'm out of my depth here.
On Wed, 1 Jun 2022, bat wrote:
This would be the original template file. The file you would edit is
'delegates.mgk'.
The configure script searches for programs and does substitutions so
that the @FOO@ value becomes the path to the program, or just the
generic name of the program if it was not found. The end result is
'delegates.mgk' (e.g.
/usr/local/lib/GraphicsMagick-1.4/config/delegates.mgk)/
It seems pretty close. Notice that the top of the 'delegates.mgk'
file includes a lot of documentation.
You have a lot of examples, and it should work if you start with the
correct file.
It is possible to have your own copy of the file which is located in
other than the formally installed location. The MAGICK_CONFIGURE_PATH
environment variable can be used to specify where to look for private
versions of files. From the documentation:
Bob
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt