Jump to content

 
Photo

raster symbols in Illustrator

- - - - -

  • Please log in to reply
9 replies to this topic

#1
Adam Wilbert

Adam Wilbert

    Legendary Contributor

  • Validated Member
  • PipPipPipPipPip
  • 276 posts
  • Gender:Male
  • Location:Bellingham, WA, USA
  • United States

Hello all,

I'm working on a map series in Illustrator that involves using a client's camera icon. The icon is a very small GIF file, and finished maps will be output for on-screen only viewing. The problem that I'm having is that Illustrator anti-aliases the image when exporting the final PNG files, which makes the line work look good, but it often messes up the clarity of the raster camera icon. I can turn anti-alias off, which helps the icon, but then the line work looks bad. However, I've noticed that occasionally the icon is placed in such a location that illustrator doesn't anti-alias it on output... my question is: Is there any way to make the icon snap to a pixel grid, such that its in the exact position needed to prevent anti-aliasing? Any ideas on how this might be done? Can I selectively tell Illustrator to "anti-alias this object, but not that one"?

The sample below is a zoomed in area of the exported PNG showing a bunch of the camera icons. Most get some sort of anti-aliasing, causing them to look blurry. Two of them (upper left and upper right), however, didn't, and they look great. The icon is being placed at a 1:1 ratio, so that 1 pixel in the icon should theoretically be able to be mapped to 1 pixel in the final image. I just need to figure out how to place the icon so that Illustrator doesn't try to split it between pixels. How do I make this something I intended to do, rather than just a happy accident?

Attached File  camera.png   32.94KB   88 downloads
zoomed in view of my problem icons

Attached File  1to1.png   19.8KB   50 downloads
100% view of the same area, as the icons will appear on screen

Interestingly enough, I've tried turning on Illustrator's "pixel preview" mode, and this anti-aliasing doesn't show up. In fact, the icons actually do shift position just a hair so that they correctly align to the pixel grid. Unfortunately, this behavior doesn't actually follow when exporting the PNG :(

Thanks in advance for considering my dilemma!

Adam Wilbert

@awilbert
CartoGaia.com
Lynda.com author of "ArcGIS Essential Training"


#2
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,320 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

Why don't you just vectorize the icon? (LiveTrace)
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter

#3
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,900 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

I agree with Hugo, the symbol doesn't look all that complicated to recreate.

Alternatively, depending on your workflow, could you export the symbols layer seperately from the rest of the map, no anti-aliasing, then combine them afterwards?
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#4
Unit Seven

Unit Seven

    Legendary Contributor

  • Moderator
  • PipPipPipPipPip
  • 266 posts
  • Gender:Male
  • Location:New Zealand
  • New Zealand

I like that idea but if you really want to stay with the supplied icons if you set your unitse to pixels and set a 1px grid (I usually use 110px with 10 subdiviosions) with snap to grid on then your raster icons should snap to the same grid it is going to export to.

You do fins that if you are trying to do this with icons that are already exporting badly (we'll call these 'off grid') that they will just snap off-grid so you will want to grab one that is exporting corectly (this means it is 'on grid') and copy it to the position of the other while snapping to your 1 pixel grid.

I have used this a lot when creating web maps with pixel fonts for small type but would love if you could apply anti-aliasing on an object level similar to the way can do to type in Photoshop.

Other option is to export base layer with anti-aliasing on, then export camera icon with it off and quickly combine in Photoshop.
S a m B r o w n

U N I T S E V E N
unit.seven@gmail.com

Miramar, Wellington
N E W Z E A L A N D

#5
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,320 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

you could of course put this together in Photoshop. Can you do some kind of dynamic placing i P-shop?
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter

#6
Adam Wilbert

Adam Wilbert

    Legendary Contributor

  • Validated Member
  • PipPipPipPipPip
  • 276 posts
  • Gender:Male
  • Location:Bellingham, WA, USA
  • United States

thanks for all the suggestions. I tried vectorizing the icon, but then of course illustrator always anti-aliased it after that, so that didn't solve my problem. It seems backwards, but I really need the 1:1 pixel representation to remain intact in the final output.

Setting up the snap-to grid in 1px increments sounds promising. I'll try that and report back.

Otherwise I'll try the two-export method. The first export will be all of the basemap, linework, type, etc with anti-aliasing on. The second export will be just the camera icons, with anti-alias off. Then merge the two together in Photoshop. I've just started digging into Apple Scripting, so this might be an excuse to up my proficiency there, as I have several hundred small maps to do!

Adam Wilbert

@awilbert
CartoGaia.com
Lynda.com author of "ArcGIS Essential Training"


#7
Gamerprinter

Gamerprinter

    Newbie

  • Validated Member
  • Pip
  • 9 posts
  • No Country Selected

I just replicated your camera icon in Xara Xtreme, so its a vector object, then exported to AI format. Your example camera icon was kind of crude, but this is an emulation except use of circles, rounded rectangles and diagonal lines. Just import and resize to your requirements then export to your clients required format. Thats it!

http://www.gamer-pri...ource/camera.ai

GP

#8
Adam Wilbert

Adam Wilbert

    Legendary Contributor

  • Validated Member
  • PipPipPipPipPip
  • 276 posts
  • Gender:Male
  • Location:Bellingham, WA, USA
  • United States

I just found a super simple solution to my problem of a very small pixel-accurate raster symbol in illustrator. It seems a bit counter-intuitive, so I thought I'd post and finish off this thread for posterity! The idea of converting the symbol to a vector object didn't work because, at such a small scale, illustrator anti-aliased the vector object just as much as the raster version.

The answer is to "rasterize" the already raster symbol. In Illustrator's effects menu, choose rasterize. Then select "screen resolution" and "anti-alias: none". Presto. Now on export to .png or other raster formats, Illustrator will anti-alias the linework, but won't touch the symbol!


Attached File  Picture_1.png   102.05KB   57 downloads
original export on the left, modified export on the right, both at 300%

Attached File  Picture_2.png   56.99KB   51 downloads
the same images at actual size

This also works with small typefaces for on-screen presentation.

Adam Wilbert

@awilbert
CartoGaia.com
Lynda.com author of "ArcGIS Essential Training"


#9
Unit Seven

Unit Seven

    Legendary Contributor

  • Moderator
  • PipPipPipPipPip
  • 266 posts
  • Gender:Male
  • Location:New Zealand
  • New Zealand

I just found a super simple solution to my problem of a very small pixel-accurate raster symbol in illustrator. It seems a bit counter-intuitive, so I thought I'd post and finish off this thread for posterity! The idea of converting the symbol to a vector object didn't work because, at such a small scale, illustrator anti-aliased the vector object just as much as the raster version.

The answer is to "rasterize" the already raster symbol. In Illustrator's effects menu, choose rasterize. Then select "screen resolution" and "anti-alias: none". Presto. Now on export to .png or other raster formats, Illustrator will anti-alias the linework, but won't touch the symbol!

This also works with small typefaces for on-screen presentation.


Thanks! Never thought of this and look forward to trying it for small fonts. I usually use pixel fonts for this and spend a lot of time making sure they are placed to the pixel grid or export one layer anti-aliased and another alised so your idea def look like a time saver.

Thanks for coming back and posting too...
S a m B r o w n

U N I T S E V E N
unit.seven@gmail.com

Miramar, Wellington
N E W Z E A L A N D

#10
sitesatlas

sitesatlas

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 184 posts
  • Gender:Male
  • Location:Madrid, Spain
  • Spain

Very useful tip, Adam -- thanks!
Michael Borop
World Sites Atlas
http://www.sitesatlas.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->