[Gridflow-dev] [#image_to_font] abstraction

Claude Heiland-Allen claudiusmaximus at goto10.org
Wed Jan 11 00:37:52 EST 2006


Hi all,

Attached is a little abstraction that makes a font grid out of an image.

In [#image_to_font-help] set the values from right to left - filename to 
save font.grid.gz as, size of each character in pixels, image to load 
(this will trigger saving!).  The image must be an integer multiple of 
the font size, otherwise behaviour is likely to be weird...

The output of [#image_to_font] is a grid[n*m,fh,fw,1](uint8), where 
(n*fh,m*fw,channels) is the size of the image, but due to a bug in [#out 
grid gzfile] they have to be saved as int32.

Black pixels in the image (defined as *all* channels being 0) are mapped 
to 1, others are mapped to 0.

This output range is so that the font can be used as a mask with [# *], 
I will send an example of this usage later.

Attached also is a test image and the output grid.gz.

matju, feel free to add this to the gridflow distribution under the same 
license of gridflow if you think it would be useful.  Note that I 
haven't tested it with [#text_to_image].


Claude
-- 
http://claudiusmaximus.goto10.org
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: #image_to_font-help.pd
Url: http://ns.artengine.ca/pipermail/gridflow-dev/attachments/20060111/ed99c840/image_to_font-help.cc
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: #image_to_font.pd
Url: http://ns.artengine.ca/pipermail/gridflow-dev/attachments/20060111/ed99c840/image_to_font.cc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hexdigits-9x21.grid.gz
Type: application/gzip
Size: 345 bytes
Desc: not available
Url : http://ns.artengine.ca/pipermail/gridflow-dev/attachments/20060111/ed99c840/hexdigits-9x21.grid.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hexdigits-9x21.png
Type: image/png
Size: 459 bytes
Desc: not available
Url : http://ns.artengine.ca/pipermail/gridflow-dev/attachments/20060111/ed99c840/hexdigits-9x21.png


More information about the Gridflow-dev mailing list