Copy link to clipboard
Copied
I'm trying to export pixel art and every time I try, it puts some pixels in the wrong place.
This is a screenshot of what I'd like to export:
This is what a png without anti-aliasing after being exported looks like.
There's different detail even though its the same amount of pixels. For example, look at the parentheses in the pixelated text.
Thanks!
Copy link to clipboard
Copied
Is the screenshot perfectly aligned to the pixel grid?
And not scaled?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
What's the effective resolution of that image? Does it match the output resolution?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
It snaps to the pixel grid? Or which grid? The pixel grid is the only thing important here.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Are your Rulers set to Global Rulers and is the X/Y 0/0 point at the upper left corner?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Can you share an example problem Illustrator file?
Either attach an Illustrator file saved as PDF or share the .AI file using filesharing; CC files, DropBox, Google, WeTransfer...
Copy link to clipboard
Copied
I attached a link via google drive. Hope this works. Thanks!
https://drive.google.com/file/d/1BlYqDQ1CKLAp40SeINd_cZTWCfdTD9va/view?usp=sharing
Copy link to clipboard
Copied
Thanks Felix, I'll need some more time tomorow to look at your file, but I am afraid that it is not as pixel accurate as you would like it to be.
Copy link to clipboard
Copied
I overlaid a 1 pixel grid (by using an artboard sized rectangle and the Object > Path > Split Into Grid option) on top of your artwork and expanded the Live Paint groups. As you can see, the text does not align with the grid and the filled rectangles deviate (although with very small amounts) from the grid. Fractional pixels do not exist so these fractional values get rounded, resulting in additional pixels when rasterized.
Maybe it is better to do this kind of work in Photoshop, which does not allow fractional pixels. When the artwork has to be scaled, resampling with nearest neighbour would keep the artwork clean.
Copy link to clipboard
Copied
I'm having trouble understanding. Take for example this file:
https://drive.google.com/file/d/1BlYqDQ1CKLAp40SeINd_cZTWCfdTD9va/view?usp=sharing
Which is nearly the same document but without the text. Even after I expand the artwork, exporting yields the same result. Just like your first image, the grid looks like it aligns perfectly.
Also, how would you suggest I transfer this document into Photoshop? When I copy and paste the rectangular grids, They end up warping in the same way.
Copy link to clipboard
Copied
The rectangles are not the exact 2 X 2 pix size and do not have the right position.
I would set the zero point at the upper left corner (double click the intersection of the rulers).
Create a new layer with a rectangle the size of the artboard, in your last example 200 x 200 px.
Select the rectangle (no fill, no stroke) and choose Object > Path > Split Into Grid
Make it 100 x 100.
Convert the grid to Live Paint and color it.
Expand the Live Paint and the result should be pixel perfect.
Copy link to clipboard
Copied
I do not suggest to transfer it to Photoshop, just that it could have been create with a hard 2pix pencil withou the anti aliasing problems because Photoshop does not have fractional pixel sizes.
Copy link to clipboard
Copied
Felix, I found a quick way to correct your current inaccurate object dimensions and positions (with the exception of text).
John Wundes has created these 2 scripts:
setAllTheThings.jsx to make all your squares 2 x 2
and pixelAlign.jsx to align the resulting squares to the pixelgrid.
I applied both scripts and the export was pixel perfect.
Scripts:
https://github.com/johnwun/js4ai/blob/master/setAllTheThings.jsx