I am using CoreDraw to generate vector icons which have to be "transformed" to bitmaps (Png) in different sizes (16x16, 20x20, 24x24, 32x32, 48x48,... 256x256, 512x512).
When doing so, I found three problems which I have to deal with:
1. Image sizes don't match with the pixel size in the export dialog, e.g. 16x16 may generate a 15x17 bitmap (the vector object is a square and "keep aspect ratio" is unchecked to force a 16x16 size)
2. Text is in low quality, especially the kerning is awful (the text ICON may look like IC O N on the exported image)
3. "Alpha Layer holes" - objects wich edges are side by side get exported with correct color values but the values for the alpha layer isn't set to opaque, so the exported image looks like a swiss cheese in certain situations.
Does anyone have seen these problems and know how to deal with them?
It is very important that your objects are properly aligned to the pixel grid before exporting.I assume you are already working with Pixels as your document drawing unit, and that your View mode also is Pixels.Make sure you have Snap to Pixels enabled and if you need to make it even more foolproof, enable Object Hinting for your objects.These two last steps will force the objects to fit the pixel grid 100% and your export size will then be correct.Remember that object outlines may increase an object's size and impact the exported size.Regarding text, convert text to curves before exporting, then undo to bring the text back to life.
Thanks for these informations, not sure where to define the drawing unit, but everything I have found (document size, grid, snap, align page to pixel grid, view, etc.) has been set to pixels.
Anyhow, the quality of the exported images is still horrible bad. I would say, that aligning to the pixel shouldn't make a great difference as the drawing object should be hundred times larger than the size for the exported pixel image, so rounding errors shouldn't happen very often.
I've found some workarounds for some problems anyhow they don't resolve all issues (and everything gets more complicate as well, so I still have no real solution):- text spacing will be done correctly when enabling an outline (I am using a setting of 0,00028pt) - I could create the target in two steps, first exporting to a larger size and afterwards resizing by PaintShop Pro to the wanted size (but resampling an image two times is not the best deal).
First off the entire exported object is about 1/3 inch wide on a low res display, on my 4K display it will be 1/9 of an inch. Your capture shows up magnified more than 20 times on my tablet.
Export your work and place it on a non-public site and view it through several browsers and different displays at different resolutions.
The example above shows an output size which is used for file icons in windows - and the different spacing between "D-O" and "O-C" can be seen easily on every screen, especially when not zoomed but displayed 1:1.
The difference in spacing between the D-O and O-C is font kerning fix it if you see it as wrong in the file before converting. Do you understand typography?
The preview in the conversion dialog shown in you post is replicating 96 DPI at about 500%
The example you show here will display in a browser only correctly between 1/3" and 1/9" and the typography needs fixed in the creation application but only if it's going to display large enough tonsee in a browser.
I would simply move the O to the right a bit and center DOC in the blue optically by moving it to the right.
Puffolino said:- text spacing will be done correctly when enabling an outline (I am using a setting of 0,00028pt)
From what I have heard, Draw uses the Windows text engine to display "true text", while it uses its own engine when it comes to curves and also text with effects.That's why you can sometimes see a slight change when converting text to curves (and that's why I suggested to do so) or adding an outline.
Puffolino said:I would say, that aligning to the pixel shouldn't make a great difference
Converting vector objects to a pixel based format can be a bit tricky.The export filter must convert the vector objects (that doesn't really have any resolution) into pixel based objects that, in the case of small icons, have very few pixels and a low resolution.This means that parts of the objects may not match the pixel grid, and they will either have to be cut off, or expanded to fill a whole pixel, which may radically change the appearance.Anti-aliasing can help making it look better but it may also add extra pixels to the exported size.That's why I suggested working in a way that eliminates as much as possible of these rounding errors.Here's a screenshot showing what can happen when things aren't properly aligned.To the left, a 12 x 12 pixel square, perfectly aligned to the pixel grid.In the middle, the square has been moved so that the edges are now aligned to the pixel center instead.Still looks like a pretty good square but the anti-aliasing has added an extra pixel (13 x 13) and dimmed the edges to make it look correct.To the right: The square is not aligned correctly at all.As you can see it is 13 x 13 pixels but the edges are darker on the bottom and right hand side, because the square fills up more of these pixels (roughly 75%) than the ones on the top and left (25%).