Re: Decomposing a B&W bitmap graphic (or ideally, a font bitmap)
Re: Decomposing a B&W bitmap graphic (or ideally, a font bitmap)
- Subject: Re: Decomposing a B&W bitmap graphic (or ideally, a font bitmap)
- From: "Roger Howard" <email@hidden>
- Date: Tue, 26 Mar 2002 12:18:41 -0800
Sounds like a job for Akua Sweet's "extract color", should be faster than opening the image in an app and querying the contents of selections you have to create and destroy.
From Akua's dictionary:
extract color: Get the color of a pixel on the screen, in a window, or in an image (or average color of a range of pixels). If no "in" and no "from", then from the screen.
extract color
[from string] -- The name of a window.
[in picture] -- The picture (or image file) to extract the pixel from.
[at bounding rectangle] -- The point (or rectangle range) to extract a color from.
Result: RGB color -- The color
Will leave implementation up to you, but it should be fairly trivial once you have this piece, assuming no major errors. The host application needs plenty of memory for Akua, but aside from that it's always worked like a charm for me.
Have fun!
Roger Howard
Digital Media Specialist
The J. Paul Getty Museum
email@hidden
310.440.6908
>
I have the not so enviable task of decomposing a set of font faces into text
>
files for downloading into a specialty-task printer. Bear with me on this
>
explanation of my need for help. I need to be able to take either a
>
black-and-white bitmapped file (tif, bmp, etc) and convert the whole thing
>
into a text file, with the pound symbol (#) representing a black pixel and a
>
period (.) representing a white pixel, and return representing the end of the
>
row of pixels.
>
>
Or, in an ideal world, I'd be able to parse a bitmapped font face directly
>
into this text format.
>
>
While I have the where-withall to create the text file, to write the text,
>
etc., I need some pointers on data structures and accessing the data
>
structures of either tif, bmp or font bitmap files so I can suck them in and
>
digest them to generate the results I need. Does anyone either:
>
(a) have a reference for the file specifications for any of those formats; or
>
(b) can recommend a good printed ref that would give me the information; or
>
(c) know of some premade solution (or a graphics/font app that is scriptable
>
to query pixel by pixel); or
>
(d) know of a scripting addition that would let me get at the data within any
>
of those file types pixel by pixel?
>
>
In general, machine time is cheap enough that it doesn't have to be a pretty
>
solution, just an effective one.
>
>
Any comments or help would be greatly appreciated.
>
=-= Marc Glasgow
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.