Skip to main content
Tony Khoueiry
Participating Frequently
July 13, 2023
Question

A thin gap between 2 objects appears on certain zooms - Remains when exporting to .png.

  • July 13, 2023
  • 4 replies
  • 674 views

i tried to:
- Change to CPU preview: doesn't always solve it on ai preview and definitely not after export.

- Add outline (stroke weight or offset path): i can make it thick to a certain extent. it solves it on ai but not for the export.
- Export using Art optimized (supersampling): doesn't work
- Add a background with the same color: not a solution for me.
- RGB vs CMYK: no results.

I hope someone knows a solution.

This topic has been closed for replies.

4 replies

Jacob Bugge
Community Expert
Community Expert
July 13, 2023

Tony,

 

"I can not unite, i need my shapes in different layers."

 

If the gap disappears when uniting (Pathfinder) or using Live Paint or Shape Builder, and if everything else fails, you may be desperate enough to try an insane suggestion:

 

You can try to:

 

1) Paste and copy the path/shape from the lower layer to the front of the upper layer (Ctrl/Cmd+F), then repeat so you have two copies above the path belonging to the upper layer and hide the top copy (in the Layers panel);

2) Unite the two paths with the Pathfinder or with Live Paint or Shape Builder; you can check whether it works for export;

3) Show the top copy from 1), then select both the top path and the united path, then use Minus front/Subtract from shape area; you can check whether it still works for export.

Tony Khoueiry
Participating Frequently
July 13, 2023

it unites completely, then it subtracts completely, going back to the initial shapes. when exporting the new shapes, the problem is there.

Jacob Bugge
Community Expert
Community Expert
July 13, 2023

Tony,

 

Since you are exporting, I wonder whether the intended coinciding sides of the two paths/shapes are really coinciding, and (even if they are) whether they (both) are at an integer X values measured in pixels, see more below. Strange things happen if your crucial parts are at non integer pixel values.

 

As you may guess, I would suggest your working in pixels as the unit, if not already.

 

 

The following may sound unforgivably outdated and boring, sorry.


If you wish to have PNGs (PNG24 (also (little) known as PNG32, it holds 24 bit colour and 8 bit Alpha channel (transparency)), of course) look crisp and clean, at least when it is (also) to be used at moderate screen resolutions, it is important to have the images in the exact desired final pixel x pixel size, or at sizes that are powers of 2 times as large (2x, 4x, 8x, and so on, the larger values can improve the appearance on high resolution screens and still ensure best possible appearance at low resolution screens); forget about image resolution which may actually lead to wrong sizes and hence blurriness, or work at 72PPI or powers of 2 times as large (144PPI, 266PPI, 576PPI, and so on).


It is easiest and safest to work at the desired size when creating the artwork.


It is important to remember that a raster image represents the whole appearance, including strokes, so to make sure you get it right you can click Show Preview Bounds in the General Preferences (and untick it afterwards).


A very common unsuitable way is to Export to PNG (remember to use PNG24 and use Transparency for artwork to be in front of different backgrounds) with a medium or high resolution, such as 300PPI.


And a common misunderstanding: (almost) 11 out of 10 times, a statement like "I created the document at 300 PPI" means that the value is chosen in Effect>Document Raster Effects Settings; however that only means that the (current) resolution of any raster effects applied to the vector artwork, such as (any kind of) Blur, is set to that value (and only unless/until the value is changed to something else); when zooming in, this resolution can be seen in contrast to and on the background of the vector artwork. So this setting has nothing whatsoever to do with the actual resolution of a raster image created from the (vector) artwork (but it ought to (at least) match it).


For clean and crisp artwork avoid JPEG; to get the colours right, you may wish/need to finalize by opening the PNG in PS (Photoshop) and attach the (missing) colour profile (such as sRGB) there.


It is also important to have the artwork and also the Artboard(s) placed fully within integer/whole pixel X and Y values in the Workspace, which means that the X and Y values at the corners must be integer; this can be ensured by using one of the corner Reference Points in the Transform palette, and then checking that all the values X, Y, W, and H, are integer (the centre Reference Point can only be used if both W and H are even numbers).


If you have issues with the Artboard(s), make sure the rulers are Global Rulers (RightClick), if not change from Artboard to Global Rulers; and to align your artboards, click the Rearrange All Artboards button in the Artboards panel. First posted by Ton here,
https://community.adobe.com/t5/illustrator-discussions/why-is-illustrator-not-exporting-artboard-size/m-p/13350220#M343886


Otherwise the resulting image will become a bit wider/taller and the extension(s) will be empty and therefore be (partially) transparent/white.


Therefore, a safe way is to create the artwork at the final pixel x pixel size and use a corresponding Artboard, then use the Legacity Save for Web (where you can look in the Image Size window for size confirmation and possibly multiply by 2, 4, 8, whatever), or use Export at 72PPI (or 144/288/576/whatever PPI), or use Export for Screens (in either way). In either case, use the relevant optimization (available with both ways); it is also convenient to have 72PPI (or 144/288/576/whatever PPI) in the Effect>Document Raster Effect Settings.


If you have pure vector artwork, you can relax a bit and have the artwork/Artboard at any size (the Artboard must have the same proportions as the final image), then use the Legacity Save for Web and set either Width or Height in the Image Size and Apply (make sure the other value is also correct).


The Legacy Save for Web may be an old carthorse, but it knows its way home, even if the driver is drunk and sleeping it off in the hay in the back.

 

Or you can switch to SVG, if applicable.

 

https://helpx.adobe.com/search-results.html?q=svg&scope=%5B%22helpx%22%5D&subscope=%5B%5D&limit=10&start_index=0&sort_orderby=relevancy&sort_order=desc&post_facet_filters=%7B%22applicable_products%22%3A%5B%5D%7D

 

Tony Khoueiry
Participating Frequently
July 13, 2023

"If you have pure vector artwork, you can relax a bit and have the artwork/Artboard at any size (the Artboard must have the same proportions as the final image), then use the Legacity Save for Web and set either Width or Height in the Image Size and Apply (make sure the other value is also correct)."

my main file is all vector. I tried this but still having the same result. Thanks for the detailed reply, i will look into your other notes and let you know. 

notes
-  i tried exporting as: .psd  the psd file has the same preview issue. 
- from ai, i am also exporting each layer separately as .png. but when i use them together again the gap appears..
- the gap appears over some of the zooms and not all. (at 50% it's very comon to appear).
- Even with a thin outline stroke on Illustrator the problem remains when i export. of course, on illustrator i would not see the gap anymore. 

thanks again





Jacob Bugge
Community Expert
Community Expert
July 13, 2023

Tony,

 

"i will look into your other notes and let you know."

 

I believe the safest way is to work in pixels (rather than inches or whatever), and that crucial parts could be this:

 

It is also important to have the artwork and also the Artboard(s) placed fully within integer/whole pixel X and Y values in the Workspace, which means that the X and Y values at the corners must be integer; this can be ensured by using one of the corner Reference Points in the Transform palette, and then checking that all the values X, Y, W, and H, are integer (the centre Reference Point can only be used if both W and H are even numbers).


If you have issues with the Artboard(s), make sure the rulers are Global Rulers (RightClick), if not change from Artboard to Global Rulers; and to align your artboards, click the Rearrange All Artboards button in the Artboards panel. First posted by Ton here,
https://community.adobe.com/t5/illustrator-discussions/why-is-illustrator-not-exporting-artboard-siz...

 

On the other hand, I am sure that Ton would have noticed the discrepancies when looking at the actual document, and said the same.

 

 

Edit: It seems that Ton just solved the riddle.

 

Ton Frederiks
Community Expert
Community Expert
July 13, 2023

The colors of the 2 objects look the same, Pathfinder Unite?

Or try a Rasterize effect before exporting. You can turn the effect off after export.

Tony Khoueiry
Participating Frequently
July 13, 2023

I can not unite, i need my shapes in different layers. 
I tried the Rasterise effect, didn't work. 
But thanks for the suggestions.

Ton Frederiks
Community Expert
Community Expert
July 13, 2023

If nothing works, maybe you can share an example .ai file for us to test.

CC filesharing, DropBox, Google, WeTransfer...

Tony Khoueiry
Participating Frequently
July 13, 2023

 this might make it more clear