Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Count number of mosaic tiles occurencies per color
#1
Hello, i'm trying to easy the process of making mosaic (real mosaics) from photos with the use of GIMP.
So far i have:

- Created a custom 37 colors palette of solid colors i use with mosaic tiles
- Created a Distort/Mosaic preset with the preferred mosaic settings (i use one color oper tile)
- Imported Image -> Distort Image -> Indexed image with palette colors (see attachment)

Now that i have a mosaic, how can i count the number of tiles i need per color (based on my palette)? (ex. 30 Black tiles, 57 Green tiles)


I'm familiar with basic programming but i'm no programmer.
Can anyone give me hints on this or does already exist a script/plugin/extension for this?



Thanks!


Attached Files Image(s)
   
Reply
#2
There is probably a script already around for this. In the meantime, the old way is 
Convert your mosaic to Indexed mode with your 37 unique colours.
In the ColorMap dialogue select a colour.
The Histogram dialogue gives the number of selected pixels
Divide that by the image tile area in pixels to give a physical tile count.
---
..onto the next colour...

   
Reply
#3
Very useful, thanks!
By the way, i see your mosaic is very neat while my mosaic is disturbed by white borders here and there despite using no tile spacing between tiles:

   

Does it depends from the image source (mine being a photo) or from some filter/operation i'm not applying?

   

Thanks indeed!
Reply
#4
I did not use the mosaic filter Wink As a demo I just used a regular RGB image, then applied Blur -> Pixelise to get the mosaic. Converted that to indexed with 37 colours, so all a bit of a fudge. There are other applications that will make a mosaic using a set of sub-images. The linux one is called metapixel.

Also a gmic filter picture-mosaic, just about to go off and try it.

edit: Ok tried it for the mosaic generation, not for counting tiles. Made a folder of coloured tiles, (10x10 pngs) and applied the gmic filter - example https://i.imgur.com/ln6Oa4C.jpg
Reply


Forum Jump: