GNOME Bugzilla – Bug 377016
support for Adobe Photoshop v6 brushes
Last modified: 2015-10-13 16:10:26 UTC
GIMP 2.3.12 and CVS HEAD refuses to load Photoshop brushes in .abr with a message: "Couldn't load data: Fatal parse error in brush file '/home/avp/.gimp-2.3/brushes/kmp_hellokitty2.abr': Unknown file format version abr '6'" This report originally comes from another user, so this is tested on at least 2 computers. Freely available brush file I tested it with is attached.
Created attachment 76846 [details] test photoshop brush
Is there any other platform/gimp version which can load the brush?
Haven't tested yet. Sorry if the header mentioning Linux is confusing.
Nothing wrong about this. As the error message clearly states, GIMP is not able to parse version 6 of the .abr file format. What's the point of filing this as a bug? If you can provide the information about how to parse version 6 ABR brushes, please reopen this bug and make it an enhancement request.
A more recent spec on .abr from v6 is available here: http://www.fine-view.com/jp/lab/doc/ps6ffspecsv2.pdf
The docs for the PS brushes only seem to document version 1 brushes (basically, the simple gray scale brushes). The new format of brushes don't seem to be addressed in those docs. But, even if it were documented, I believe that GIMP would need a lot of new functionality to really make use of new style PS brushes. PS seems to support a much wider array of brush parameters than GIMP can currently use. If there are any unencumbered docs on how the new brushes work, I would be interested to see it.
Support for brush PS v2 brushes v2 leads my curious mind to v6 brushes. I found out that there is at least one open source tool to parse them: abrViewer. http://abrviewer.sourceforge.net/ The source is C# but there is no major problem reading it. During a cloudy monday, I hacked abr2gbr to recognize v6 brushes and extract them. It should be possible to include it also in Gimp. The main difference between v1|2 and v6 is the section encapsulation. The 'samp' section contains raw brushes data. The 'desc' section contains brush parameters for PS, including name. The 'patt' section is empty in files I used. - v6 brushes file format version: short = 6 subversion: short = [1|2] SECTION* - SECTION tag: char[4] = "8BIM" tagname: char[4] = ["samp"|"patt"|"desc"] size: long data: 'size' bytes
Created attachment 87917 [details] abr2gbr handling PS brushes v6 This is a modified abr2gbr. Get original sources from Marco Lamberto at http://the.sunnyspot.org/gimp/ Replace original abr2gbr.c by the attached one. You can add "-DWRITE_GBR=FALSE" to get an abrdump application. The modified binary recognized attached brush as a set of 8 brushes (ABR file version 6 subversion 1).
I wrote a loader for ABR files. http://registry.gimp.org/plugin?id=9571 I also have code to parse 8BIMdesc section. See specification in comment #5 . The only problem is a null object here, but simply discarding it solves the problem. 8BIMdesc section contains serialized brushPreset objects. Each brushPreset contains a brushSample. brushSample useful fields include name, key and spacing : other parameters are not implemented in GIMP brush. The key allow to retrieve corresponding data in 8BIMsamp section.
Created attachment 88566 [details] Parser for 8BIMdesc section in .abr v6 brushes This little tool show the objects serialized in 8BIMdesc section. brushPreset[n].Brsh.Dmtr : max (width, height) usually in pixel brushPreset[n].Brsh.Nm : name of brush sample brushPreset[n].Brsh.Spcn : spacing - could be in pixel or percentage brushPreset[n].Brsh.sampledData : key for data in 8BIMsamp section Brush presets seems to be reverse in 8BIMdesc compared to 8BIMsamp samples order.
Just for completeness, the sample in comment #1 comes from Kiss My Pixels site. http://www.kissmypixels.com/brushes_ps7_1.html By curiosity, download Paint Shop Pro file, explode .zip and move kpm_hellokitty.jbr to ~/gimp-2.3/brushes/kpm_hellokitty.abr: you've got the desired brushes. On this site at least, .jbr are equivalent to .abr v1 already supported in gimp.
Created attachment 89240 [details] [review] Support for abr v6 files - against gimp 2.3.17 This patch does the following things: - Support for ABR v6 sample brushes - Fix ABR v2 names to 'filename-sample name' scheme : this way all brushes from an abr file appear side to side. - Create a function rle_decode() to avoid duplicate the whole thing Limitation for patches: - Real sample name not retrieve from 8BIMdesc section - Spacing for all brushes fix to 25% Tests done: http://www.kissmypixels.com/ - kmp_ladybugs.jbr (JBR - ABR v1) http://www.digital-beauty.net/ - butterflies.abr (ABR v1) http://www.zlepoizon.com/zlepoizon/ressources/home_ressources3.php - retro.abr (ABR v2) http://www.kissmypixels.com/ - kmp_hellokitty2.abr (ABR v6.1) http://www.amaranthdreams.com/brushes.htm - Birds.abr (ABR v6.2)
Very nice, I have applied the patch locally and will test it later (and commit if it works fine).
Fixed in SVN: 2007-06-04 Michael Natterer <mitch@gimp.org> * app/core/gimpbrush-load.c: applied patch from Eric Lamarque which adds support for ABR v6 brushes. Did some minor cleanups in the patch, reordered functions and generally fixed error handling of the ABR parsers. Fixes bug #377016.