I'm making an illustration that contains only black lines, on a white background. The lines are 1 pixel thick. Sometimes those lines will curve a bit. Sometimes there will be a circle. But the stroke is always 1 pixel.

Now, when I export the png file, I get a smoothing effect, that is useful for visual purposes, however, for programming reasons, I want to have a perfect 1 pixel by 1 pixel square in a perfect coordinate, not blurry edges that transform 1 pixel in 4 or 5 to make it look good.

Is there any way to create/export this file that way?.


What you are describing is called anti-aliasing. This is what usually happens when you export a vector image to a raster image. Specifically, the purpose of this is to ensure that the images are rendered with smooth lines rather than pixelated lines. This is the default behaviour when exporting as a raster image.

However, you can easily output images without ant-aliasing. In Illustrator click File > Export As, choose a raster format such as JPEG, PNG or TIFF, and switch off the anti-aliasing option.

If you want to preview the pixels in Illustrator as you work on them you can switch off anti-aliasing in the Preferences under the General tab, and you can switch to Pixel Preview under the View main menu option.

Here I have switched off anti-aliasing in the preferences and switched to Pixel Preview.

enter image description here

To the right above is the "Export As" dialog, and below is the output file

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.