![]() inkscape -z -e hiero_A1_big.png hiero_A1.svg -w 980 The output size here is twice as large as the file we traced, just to leave plenty of pixels to work with. Use Inkscape to convert the SVG back to a large PNG. I couldn’t find a reliable way to programmatically crop the image back to its original padding as an SVG, but in my case I needed to convert it back to a bitmap anyway, so I cropped it later. The next steps will reproduce a smaller PNG with transparency and the correct padding. If you only want a vector, then you can stop here. It can be increased for a bolder, darker glyph, or reduced for a finer one. The k value affects the threshold operation. Here, we will produce an SVG so that we can make it transparent. The potrace program will threshold and trace the input image. This preparation is important, because a large blurry graymap will retain a lot more detail than the original image when a threshold is applied to convert it pure black and white: The 29×38 grey+alpha input becomes a blurry 490 x 580 greymap surrounded by whitespace. Padding by 10px on every side to reduce distortion around the edges.Ĭonvert hiero_A1.png -bordercolor white -border 10x10 \.These transformations make sure that the detail is preserved for tracing. The tracing program will convert the image to pure black & white as its first step. Inkscape to produce a high-quality raster.You can still see some artifacts because of the low resolution of the input, but it’s clearly an improvement. If we’re smart about it, the glyph can be rendered like this: The good news is that even from a small image, there is quite a lot of detail which we can use. So small images become very pixellated when you resize them. ExampleĪ good example might be this picture of a hieroglyph from the WikiHiero MediaWiki extension, which is 28 pixels wide: I’ll share here a few tricks that I use to get the detail out of each letter as a vector, so that it can be rendered at a higher resolution. I have recently been working with some low-resolution bitmap fonts for a few projects, which needed to be re-sized for different uses. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |