# Author: Chris Mohler
# Copyright 2009 Chris Mohler
# License: GPL v3
# GIMP plugin to count the number of tiles of the FG color
This plugin breaks the layer into tiles and counts the number of tiles containing a percentage of the FG color, and optionally draws a grid in the bg color. The plug-in also reports the total percentage of the FG color in the layer. For best results, use a flattened copy of your layered image.
Parameters:
Tile size: Enter the tile size in pixels
Minimum Percent: Ignore tiles with lower than this percent of the fg color. EG, enter 5 to skip tiles with less than 5% of the FG color
Draw Grid: toggle this to add the grid layer
CAVEATS:
This thing is SLOW - it examines every pixel.
It does not seem to find some colors - for best results, use solid colors like (255,0,0) - solid Red, etc. You will know when this happens - the plug-in will report 0 tiles and 0.0%.
Attachment | Size |
---|---|
count_mosaic_tiles.py | 2.54 KB |
count_mosaic_tiles_02.py | 2.54 KB |
Comments
Where are results shown?
Hmm - I'm using
same results using single line message - no dialog raised
You just can't expect
You just can't expect gimp_message to raise a popup message window. The error console dockable dialog is there to get rid of these.
If you want control over dialogs, then you have to derive a python plugin from gimpplugin and not gimp-fu.
Huh?
According to the PDB:
gimp-message
Internal GIMP Procedure
Displays a dialog box with a message.
Parameters
message STRING Message to display in the dialog
Additional Information
Displays a dialog box with a message. Useful for status or error reporting. The message must be in UTF-8 encoding.
So, the documentation for this function is wrong? Is there another function I should be looking for?
It depends