After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 377016 - support for Adobe Photoshop v6 brushes
support for Adobe Photoshop v6 brushes
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Data
2.3.x
Other All
: Normal enhancement
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2006-11-19 14:57 UTC by Alexandre Prokoudine
Modified: 2015-10-13 16:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test photoshop brush (239.83 KB, application/zip)
2006-11-19 14:59 UTC, Alexandre Prokoudine
  Details
abr2gbr handling PS brushes v6 (16.58 KB, text/plain)
2007-05-09 21:58 UTC, Eric Lamarque
  Details
Parser for 8BIMdesc section in .abr v6 brushes (6.01 KB, text/plain)
2007-05-21 21:41 UTC, Eric Lamarque
  Details
Support for abr v6 files - against gimp 2.3.17 (14.50 KB, patch)
2007-06-02 15:18 UTC, Eric Lamarque
committed Details | Review

Description Alexandre Prokoudine 2006-11-19 14:57:51 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.
Comment 1 Alexandre Prokoudine 2006-11-19 14:59:06 UTC
Created attachment 76846 [details]
test photoshop brush
Comment 2 Michael Schumacher 2006-11-19 15:12:15 UTC
Is there any other platform/gimp version which can load the brush?
Comment 3 Alexandre Prokoudine 2006-11-19 15:14:33 UTC
Haven't tested yet. Sorry if the header mentioning Linux is confusing.
Comment 4 Sven Neumann 2006-11-21 14:35:32 UTC
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.
Comment 5 Alexandre Prokoudine 2006-11-21 14:56:02 UTC
A more recent spec on .abr from v6 is available here: http://www.fine-view.com/jp/lab/doc/ps6ffspecsv2.pdf
Comment 6 Adrian Likins 2006-11-21 20:48:26 UTC
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. 
Comment 7 Eric Lamarque 2007-05-09 20:54:31 UTC
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

Comment 8 Eric Lamarque 2007-05-09 21:58:13 UTC
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).
Comment 9 Eric Lamarque 2007-05-14 21:28:02 UTC
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.
Comment 10 Eric Lamarque 2007-05-21 21:41:57 UTC
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.
Comment 11 Eric Lamarque 2007-05-27 16:28:53 UTC
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.
Comment 12 Eric Lamarque 2007-06-02 15:18:50 UTC
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)
Comment 13 Michael Natterer 2007-06-02 16:05:58 UTC
Very nice, I have applied the patch locally and will test it later (and
commit if it works fine).
Comment 14 Michael Natterer 2007-06-04 10:43:21 UTC
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.