14 Replies Latest reply on Oct 23, 2012 3:10 AM by Jonas Hummelstrand

    Importing *.ai files as vectors, aliasing issues

    ScottishCaptain

      Greetings to all.

       

      I've got a quirky problem here in AE.

       

      I'm trying to import some vector files from Adobe Illustrator into AE and I'm having one hell of a time doing so. The files import just fine as merged footage, but when I drop them into a composition the lines appear all aliased and therefore blurry.

       

      What is puzzling me is that these lines fall on whole pixels within Adobe Illustrator. The object is positioned on whole pixels in AE (as it should be). Maybe 80% of the lines are fine- perfectly crisp and sharp (as I'd expect), but the other 20% are being aliased for some reason utterly beyond me. I've tried changing the aliasing options in the footage interpretation from fast to accurate- no avail. Enabling or disabling continously rasterize does nothing as the footage isn't being scaled.

       

      I know vector files are, well, vector, and certain things like curves and stuff are supposed to be aliased. What I don't understand is why AE is quirking out and aliasing lines that are otherwise perfectly straight and should create a totally sharp edge. AE seems to think this isn't the case and I get an extra border of pixels that shouldn't be there.

       

      Why is this happening?

       

      -KT

        • 1. Re: Importing *.ai files as vectors, aliasing issues
          Mylenium Most Valuable Participant

          Screenshots tell a lot. That aside, AI thinks in inches and point, not pixels, even when you enable align to pixel grid. It's quite possible that its calculations do not match an exact pixel. Also, of course, because of this, the AI file's DPI setting matters.

           

          Mylenium

          • 2. Re: Importing *.ai files as vectors, aliasing issues
            Jonas Hummelstrand Level 2

            Enable the "sun-like" icon ("Collapse Transformations") in the comp window of on your AI layer to make sure AE always rasterizes the vector data at full resolution.

            • 3. Re: Importing *.ai files as vectors, aliasing issues
              Mylenium Most Valuable Participant

              Enable the "sun-like" icon ("Collapse Transformations") in the comp window of on your AI layer to make sure AE always rasterizes the vector data at full resolution.

               

              He already did to no avail...

               

              Mylenium

              • 4. Re: Importing *.ai files as vectors, aliasing issues
                ScottishCaptain Level 1

                http://s9.postimage.org/80zh9qy0t/adobe_illustrator.png

                http://s11.postimage.org/75iz75ttd/adobe_aftereffects.png

                 

                Appologies about the links, I can't seem to inline them.

                 

                AI is currently configured to work entirely in pixels (though your comment about it "thinking" in inches is interesting, and would explain some other AI stuff I've been wondering about). The AI paths were rasterized at 72px, art sampling.

                 

                The quirky bit is visible in the AE snapshot- you can see on the right hand side, there's some grey pixels that shouldn't be there. The points that make up that edge fall on whole pixels on the X axis, so I'm confused as to why this is happening. The same aliasing is present when I scale the vectors up in AE with continously rasterize enabled.

                 

                -SC

                • 5. Re: Importing *.ai files as vectors, aliasing issues
                  Jonas Hummelstrand Level 2

                  Have you tried resaving the AI files into an older AI format? Unless you're doing something fancy, you can normally get away with saving to "Illustrator 8" or even "Illustrator 3."

                  • 6. Re: Importing *.ai files as vectors, aliasing issues
                    ScottishCaptain Level 1

                    That seems to change the aliasing a bit. It fixes the edges shown in the screenshots, but introduces issues with two of the other edges (same issue).

                     

                    I've tried saving the file as different AI versions before, as EPS files (with different versions), and as PDF files. It is exceedingly rare that anything imports into AE and aliases with sharp crisp lines where I expect them these days. This isn't the only example, I've noticed this issue in umpteen other files as well (mostly with smaller pixel-perfect icons that I've drawn up in AI and expected to use in AE in one of my fantasy UIs).

                     

                    CS5 had a similar issue, but I could get around it by adding 10px to the document bleed in every direction before saving in AI. The vectors would come in "clean" and with continually rasterize enabled, I could scale them up or down (ie, 50% or 200%) and everything would remain crystal clear & sharp. Apparently this trick no longer applies to CS6.

                     

                    -SC

                    • 7. Re: Importing *.ai files as vectors, aliasing issues
                      Mylenium Most Valuable Participant

                      Is your artboard origin set properly in AI? You know, each artboard has now its own ohne... Likewise, the artboard itself would have to fit full pixel based sizes... Can only be one of those things IMO, if you already have checked the otehr stuff...

                       

                      Mylenium

                      • 8. Re: Importing *.ai files as vectors, aliasing issues
                        ScottishCaptain Level 1

                        Yes, the origin is setup properly (and falls on whole pixels itself). It's basically setup however AI configures it when you create a new file with the dimensions already in mind.

                         

                        I've checked damned near everything I can, so I'm still at a loss as to why this is happening.

                         

                        I noticed that in *some* cases, doing the following fixes the aliasing issue:

                         

                        1) Create a black rectangle the size of the artboard in AI

                        2) Arrange all my existing vector paths over the black rectangle

                        3) Right click on them, create a new clipping mask

                        4) Save the Illustrator file

                         

                        I would think that this would effectively "do nothing", because the end result is exactly the same as simply having the vector paths sitting there with a black fill and no stroke. What is really bizarre is that this fixes the issue in AE- the lines appear crisp and clear, and scale properly as expected.

                         

                        However this solution only seems to work for some situations. I still have other AI files that contain paths that fall on whole pixels, but are being aliased in AE- and this trick doesn't seem to fix those.

                         

                        *sigh*... Why is this so difficult?

                         

                        -SC

                        • 9. Re: Importing *.ai files as vectors, aliasing issues
                          Jonas Hummelstrand Level 2

                          Make sure you file a bug http://adobe.com/go/wish but I can't replicate on my machine so my gut is telling me there's something weird with your files or your setup.

                          • 10. Re: Importing *.ai files as vectors, aliasing issues
                            Mylenium Most Valuable Participant

                            Can't know, but if there is no clear pattern, it is probably a bug buried deep somewhere. Could be a precision issue of sorts. As Jonas suggested, report it. If you can go without CR, you can probably fix some of that stuff by applying the Mosaic effect and clamping out unwanted pixeels with levels adjustements. Also Minimax will "squarify" stuff and may come in handy in some situations.

                             

                            Mylenium

                            • 11. Re: Importing *.ai files as vectors, aliasing issues
                              Jonas Hummelstrand Level 2

                              If you actually want the exact pixels, why not go through Ps as a workaround and generate bitmap images for AE?

                              • 12. Re: Importing *.ai files as vectors, aliasing issues
                                Rick Gerard Adobe Community Professional & MVP

                                Ok, I took a look at the images:

                                 

                                This is the one from Illustrator:

                                http://s9.postimage.org/xjrtmrhkt/adobe_illustrator.png

                                This is the one from AE:

                                http://s11.postimage.org/b1wb35esx/adobe_aftereffects.png

                                I'm guessing that these images are screenshots viewed at about 3200%. This would be easier to figure out if I had the original AI file but I'd bet that the reason the AI screenshot shows the gray pixels on the edge is that the AI file is being interpreted as an odd number of pixels wide. This brings sub pixel sampling into play and gives you the Antialiasing your seeing.

                                 

                                You state that the AI file is set to Rasterize paths at 72PPI. What you probably meant was that the Document Raster Effects settings were set to 72DPI. Document raster settings have no effect in After Effects. What is probably happening here is that the artwork in Illustrator isn't exactly lined up on the pixel grid so AE is adding one pixel to the interpreted width of the artwork. If it is an Illustrator file imported as a comp using layer sizes then you should be able to see this in the info palette. If your artwork is imported as a file instead of a comp then the artboard size will be the dimensions. If you imported as a comp then you will see position values that are not on the nearest whole pixel. If the artwork is not exactly positioned in AI on a pixel then you will see whole pixel values for position and anchor point unless the artboard is an odd number of pixels high or wide.

                                 

                                Take a look at this example. Same artwork, exactly positioned on the artboard, an even number of pixels high and wide with 2 different raster settings give exactly the same appearance on the right side but show sub pixel sampling on the left produces gray lines when the Test2.ai file is out of position by a fraction of a pixel.  The red glow was created in illustrator with the two different Document Raster Settings shown.

                                 

                                aiPositionTest.png 

                                The screenshots in AE were taken at 400%.

                                 

                                Fix the position of your AI layer in AE or fix the positioning of the artwork in AI and you should be able to clean up the right side of your image in AE.

                                 

                                By the way, antiailising issues and edges like you're seeing in the screenshots you posted are perceived differently in a movie than in a still. There's no way you can keep your illustration sharply defined with no gray pixels on the sides if the layer is moving at anything other than a whole pixel multiple per frame across the screen. Moving at whole pixel values per frame may actually produce a visual jittering that is very hard on the eyes even though the frames are sharp as a tack. The only way you can judge the quality of a movie is to watch it played back at speed on the device you're going to use for playback. I was shocked the first time I saw a title sequence I created for a movie transferred to film and projected. The jittering was awful and I had to redo the timing of the entire project. It looked great played back on my computer screen, horrible on film. After I fixed it the titles looked great on both.

                                • 13. Re: Importing *.ai files as vectors, aliasing issues
                                  ScottishCaptain Level 1

                                  Yeah, it looks like AE is importing things with an additional pixel on each dimension.

                                   

                                  It seems like all I have to do is properly setup a clipping mask. This doesn't seem to work if I drag out the clipping rectangle by hand (snapping to the page via smart guides), AE imports it with the extra pixel again and the aliasing is out of whack. It appears as though Illustrator tends to create vectors that aren't totally perfect, even if that's what the user interface is telling you.

                                   

                                  If I click on the artboard with the rectangle tool and type in the exact dimensions of the rectangle, then setup the clipping mask so the original artwork is contrained within those dimensions perfectly- then it imports into AE with the proper dimensions, and the aliasing looks fine. I guess I'll just have to start making sure I setup clipping masks before I import into AE, or face the consequences of whacky aliasing. Not a big deal, that's life I guess.

                                   

                                  By the way, antiailising issues and edges like you're seeing in the screenshots you posted are perceived differently in a movie than in a still.

                                   

                                  Yes, if it was moving then I wouldn't care.

                                   

                                  90% of the time, these elements are totally static though. The opacity is being varied but that's about it. It's just a small part of a larger animated user interface for an imaginary computer system. There are a few sequences where things need to re-arrange themselves within the "virtual" operating system, but for the most part they remain still and need to otherwise look as sharp as possible. The AE project(s) are being rendered down to various looping videos and sequences that are being played back full-screen on a variety of IRL LCD monitors and iPhones/iPads that the actors are using as props.

                                   

                                  This is the first time I've been asked to handle the actual animation- usually all I land up doing is the stuff in AI and PS (where wrangling aliasing is easy enough). So it's been a bit of a surprise trying to tame AE into accepting all the various vector elements I need to deal with to create the intented results.

                                   

                                  -SC

                                  • 14. Re: Importing *.ai files as vectors, aliasing issues
                                    Jonas Hummelstrand Level 2

                                    Could it be that you have snapping enabled in Illustrator? That would explain that manual placement doesn't work correctly.