Now, I'm having a very difficult problem
I convert a font to hex code, and can resize it
as follows :
1. I use lcd font maker software to create char A font Arial size 18
2. Then I convert to hex code
(see picture to understand)
How do I resize the image when data input is hex code or binary, and result is hex code or binary?
Please suggest me, or document related to this issue.
Here i dont know what do you mean by resize the image
1> In lcd font maker software you have created one image
2> Now you have encoded that image in digital form and made array of hex code.
Now i think you want to pass this array of hex code to some other program and want to recreate/decode that image back ? if then you can write one program using same reverse logic which can decode that data and create original image back.
And if you want to resize image then you need to understand/use the concept of pixcel sampleling and all stuff
Wiki page "Image scaling" could be good stating point. There is list of different scaling methods.
Result of scaling may look ugly, especially if you have 2 color display.
So consider use of two or more presized fonts.
Related
i was working on a program that will, depending on the input draw, shapes of different colors onto a bitmap file, it works fine if i just have to draw one shape, but if i for example take two or more shapes it just draws over the old picture and the old one gets lost but i need them to overlay to create more complex pictures. Is there a way when i am writing to a bitmap file to skip over parts i dont want to write over ? I also tryed making an array in which i would save all the pixel data, but that doesnt work if i take a bitmap of a size larger than 800x800, depending on the size of the type of the elements of the array. I am open for any suggestion and comment. Thank you in advance.
You need to draw the second shape using a transparent background, how you would do that is entirely up to you as you don't provide any information about what technology you are using.
I have a standard jpeg image, which I use within some commercial software to colorize other data (by mapping the image's color onto the data). Then I export the colored data from this software to an XYRGB ascii file, i.e. I store the data information in the first two columns of each row and then the three RGB colors in the last three columns.
Since I need to convert the color to CIELab or CIELuv, it seems I need to know which exact colorspace (RGB, sRGB, gamma, whitepoint - you name it) my RGB values are in. But the question is: How can I find out? Or could I just assume a certain profile being a good approximation?
(Remark: The company of the commercial software I used was not able to tell me any specifics...)
If you don't know the provenance of the image, there's not anything you can do to determine the color space from the RGB data alone. It's a little like having a blueprint without a scale. You could guess and check with an application like Photoshop that can assign a profile to an image but even then it's not always obvious which is correct unless the image contains colors you can recognize as correct.
For many images sRGB is good guess. Most image on the web are sRGB and many non-color managed apps assume sRGB. But just understand that it is still a guess. If color accuracy is critical, you need the profile.
I am trying to smooth text rendering using anti-aliasing.
But it's not anti-aliased.
First line is a png image created using pango and cairo.
Second line is just an html <span> tag. It's in firefox, Ubuntu with Gnome DE.
The difference can be better understood if you compare "W" and "v"
between two lines.
The code responsible to draw text can be found on http://pastie.org/1073683
Font options are set on lines 17 and 20 like so:
// setting up antialiasing
cairo_font_options_set_antialias(cfo, CAIRO_ANTIALIAS_GRAY);
// set the font options to cairo
cairo_set_font_options(this->cro, cfo);
Could anyone please tell me how can I make those two lines look the same?
cairo_font_options_set_antialias(cfo, CAIRO_ANTIALIAS_GRAY);
You asked for it, you got it. To get a match you'd need CAIRO_ANTIALIAS_SUBPIXEL. This is however not appropriate when you draw text to an image that might be displayed on another machine. There's no guarantee that the monitor on that machine is an LCD panel with the RGB stripes in a predictable order. Or that it in landscape orientation. Or that it is displayed with the exact original size. When there's a mismatch, the text will look quite poor.
How do you do your own fonts? I don't want a heavyweight algorithm (freetype, truetype, adobe, etc) and would be fine with pre-rendered bitmap fonts.
I do want anti-aliasing, and would like proportional fonts if possible.
I've heard I can use Gimp to do the rendering (with some post processing?)
I'm developing for an embedded device with an LCD. It's got a 32 bit processor, but I don't want to run Linux (overkill - too much code/data space for too little functionality that I would use)
C. C++ if necessary, but C is preferred. Algorithms and ideas/concepts are fine in any language...
-Adam
In my old demo-scene days I often drew all characters in the font in one big bitmap image. In the code, I stored the (X,Y) coordinates of each character in the font, as well as the width of each character. The height was usually constant throughout the font. If space isn't an issue, you can put all characters in a grid, that is - have a constant distance between the top-left corner of each character.
Rendering the text then becomes a matter of copying one letter at a time to the destination position. At that time, I usually reserved one color as being the "transparent" color, but you could definitely use an alpha-channel for this today.
A simpler approach, that can be used for small b/w fonts, is to define the characters directly in code:
LetterA db 01111100b
db 11000110b
db 11000110b
db 11111110b
db 11000110b
db 11000110b
The XPM file format is actually a file format with C syntax that can be used as a hybrid solution for storing the characters.
Pre-rendered bitmap fonts are probably the way to go. Render your font using whatever, arrange the characters in a grid, and save the image in a simple uncompressed format like PPM, BMP or TGA. If you want antialiasing, make sure to use a format that supports transparency (BMP and TGA do; PPM does not).
In order to support proportional widths, you'll need to extract the widths of each character from the grid. There's no simple way to do this, it depends on how you generate the grid. You could probably write some short little program to analyze each character and find the minimal bounding box. Once you have the width data, you put it in an auxiliary file which contains the coordinates and sizes of each character.
Finally, to render a string, you look up each character and bitblit its rectangle from the font bitmap onto your frame buffer, advancing the raster position by the width of the character.
We have successfully used the SRGP package for fonts. We did use fixed-pitch fonts, so I'm not sure if it can proportional fonts.
We're using bitmap fonts generated by anglecode#s bitmap font generator :
http://www.angelcode.com/products/bmfont/
This is very usable as it has XML output which will be easy to convert to any data format you need.
Angel Code's bmfont also adds kerning and better packing to the old alternative that was MudFont.
Does anyone know of any way to convert a simple gif to xaml? E.G. A tool that would look at an image and create elipses, rectangles and paths based upon a gif / jpg / bitmap?
Inkscape can trace bitmaps, and can save directly to XAML. And, it happens to be free. I've used it to trace a lot of bitmaps and it's worked really well for me.
Illustrator has a trace tool which will do this
a cheaper option might be
http://vectormagic.com
it will export a svg that you should be able to convert to xaml
A combination of Vector Magic followed by ViewerSVG produces the best quality results for me.
With this online converter you can convert an image to SVG Format. then download Converted File and open it in a text File Editor then you can easily copy path data
image.online-convert