Professional Web Applications Themes

Anti-Alias Cutoff - Adobe Illustrator Macintosh

I have diagrams that need to be saved for web as gifs. The top, left, right and bottoms are cut off by about 1 pixel. I know exactly what is going on as it's cutting it at the registration point of the data and not taking into account the extra pixels needed for anti-aliasing. I've seen this problem with Illustrator for years and years. My fix has always been to include a dummy box with no stroke or fill to encompass and compensate for it. It's always worked so I've never really thought about it. But... I have 1100 diagrams ...

  1. #1

    Default Anti-Alias Cutoff

    I have diagrams that need to be saved for web as gifs.

    The top, left, right and bottoms are cut off by about 1 pixel. I know exactly what is going on as it's cutting it at the registration point of the data and not taking into account the extra pixels needed for anti-aliasing. I've seen this problem with Illustrator for years and years.

    My fix has always been to include a dummy box with no stroke or fill to encompass and compensate for it. It's always worked so I've never really thought about it.

    But...

    I have 1100 diagrams to convert to gifs. Yes, 1100 is to read "eleven hundred" but it might as well read "eleventy billion". They're all different sizes and in different positions on the artboard so a batch paste of the dummy box won't work. I need some serious professional advice or a I need somebody to please point me to the button that fixes this.

    Please, I'm getting carpel.

    Thanks
    hitpawz@adobeforums.com Guest

  2. #2

    Default Re: Anti-Alias Cutoff

    I see "Clip to Artboard" on the Save for Web box, but that doesn't sound right to me. That will make all the gifs 8.5 x 11 right?
    hitpawz@adobeforums.com Guest

  3. #3

    Default Re: Anti-Alias Cutoff

    I've gotten through 355 dummy boxes in 1.5 days. Only 745 more to go. Is there anybody out there that has an idea on this yet?

    Basically, BUMP
    hitpawz@adobeforums.com Guest

  4. #4

    Default Re: Anti-Alias Cutoff

    I bet you could writ an Applescript that would get the dimensions of each diagram, create a rectangle around it a specified amount larger and do your save.

    How is this set up ? Does one doent contain just one diagram or multiple diagrams? I assume that the diagrams are Illustrator files...

    -Jason
    Jason_Howard@adobeforums.com Guest

  5. #5

    Default Re: Anti-Alias Cutoff

    One doent contains one to two diagrams. Usually (99/100) it's just one diagram. They're all different sizes. They're all illustrator files.

    I've never ventured into applescripting. Lingo is the only language I've ever semi-mastered. No clue how translatable that is to Applescript. The only problem is that if I start losing my focus on chugging away at adding these boxes, I'll fall behind an already late schedule, so there's little time for experimentation. I take 5 minute breaks every hour and come here to prey for an answer.

    However, the thought is intriguing. Where should I look for Applescript help?
    hitpawz@adobeforums.com Guest

  6. #6

    Default Re: Anti-Alias Cutoff

    macscripter.net is a good start. However there are several online tutorial and such around. The Apple website also has a section on it. Applescript is worth the time learning it, particularly for situations like your currently in.

    I quickly pieced togther a script that should help. Ideally you could set it up to target a folder full of Illustrator files and it would open each file and create the box and save them how you want them and put them in a different folder, all while you drink your coffee. Unfortunately I don't have time to figure out all that, however if you copy the below stuff and paste it into a Script Editor doent, save it, and put it in you illustrator/Presets/Scripts folder it will pop up in your File/Scripts menu the next time you relaunch Illustrator. Then you can assign a keyboard shortcut to it. The script looks at all the art in the open doent and creates a no fill no stroke rectangle behind it that is 1 point larger on all sides. You will have to manually open and save the files.

    tell application "Illustrator CS"
    activate

    -- This identifies the art in the open doent
    set artToBound to every page item of doent 1

    --Gather a list of the bounds of all the items
    set boundsList to {}
    repeat with i from 1 to count of items in artToBound
    set vb to visible bounds of item i of artToBound
    set boundsList to boundsList & {vb}
    end repeat

    --Call to the subroutine to take the list of bounds and return only the outermost bounds
    set outerBounds to my findOuterBounds(boundsList)

    --Add a specified amount to the the bounds of the artwork.
    set IncreaseAmount to 1 --In points. Change this number to adjust how much larger than the artwork the final bounding box is.
    set boundsNew1 to (item 1 in outerBounds) - IncreaseAmount
    set boundsNew2 to (item 2 in outerBounds) + IncreaseAmount
    set boundsNew3 to (item 3 in outerBounds) + IncreaseAmount
    set boundsNew4 to (item 4 in outerBounds) - IncreaseAmount
    set outerBoundsNew to {boundsNew1, boundsNew2, boundsNew3, boundsNew4}

    --Make the invisible bounding box using new larger bounds.
    set boundingBox to make rectangle at end of doent 1 with properties {bounds:outerBoundsNew, stroked:false, filled:false}

    end tell

    on findOuterBounds(xList)
    set {leftRes, topRes, rightRes, bottomRes} to xList's first item
    repeat with boundsRef in rest of xList
    set {leftVal, topVal, rightVal, bottomVal} to boundsRef's contents
    if (leftVal is less than leftRes) then set leftRes to leftVal
    if (topVal is greater than topRes) then set topRes to topVal
    if (rightVal is greater than rightRes) then set rightRes to rightVal
    if (bottomVal is less than bottomRes) then set bottomRes to bottomVal
    end repeat
    return {leftRes, topRes, rightRes, bottomRes}
    end findOuterBounds
    Jason_Howard@adobeforums.com Guest

  7. #7

    Default Re: Anti-Alias Cutoff

    Just a thought ... Rather than using a dummy box, can you duplicate your elements, add a stroke of the correct width to create your extra pixel or two, then color that with a fill and stroke of None? If so, I presume you could create an Action in CS to go through all those steps for you automatically.

    As an example:
    Select All
    Resize Uniform at %100 (Copy)
    Path/Offset Path 1 pt.
    Send to Back
    Fill=None
    Save for Web
    jonf@adobeforums.com Guest

  8. #8

    Default Re: Anti-Alias Cutoff

    Jason, thanks a million for the script. Well above and beyond what I was hoping for and very appreciated. I'll check out your links and give your script a test run soon and will post the results. I'm very anxious to have this work.

    Jon, your idea sounds intriguing and I'll give that test run too.

    The only forum that comes close to the generosity and breadth of knowledge to this is Newtek's and it pales in comparison.

    Again, much appreciated.
    hitpawz@adobeforums.com Guest

  9. #9

    Default Re: Anti-Alias Cutoff

    Jason, I'm using Ai 10, not CS. Sorry for not clarifying that earlier. Can I just replace the line

    tell application "Illustrator CS"
    activate

    With

    tell application "Illustrator 10"
    activate

    ?? Would I need to edit any other lines?

    Jon, your idea was good, but it didn't work. The reason is that these diagrams are line art (no fills) and offsetting a path on a horizontal line only expands it verticaly. Same as just increasing the stroke size. So if the terminating object is just a stroked line, it doesn't increase the border of my Giff. It makes the lines thicker but the right and left-most objects of the diagram would have to be vertical lines while the top and bottom-most objects would have to be horizontal lines to work. It has sparked some other ideas until I can try Jason's script though, so It's on the right track.
    hitpawz@adobeforums.com Guest

  10. #10

    Default Re: Anti-Alias Cutoff

    I GOT IT!

    Here's what I did and it worked. It's WAY more simple than I anticipated and I thank Jon for the idea sparkage.

    Copy
    Paste to Back
    Outline Stroke
    Set stroke to white - 4pts

    That's it. Fortunately for me, these are all going on a white background as this would not work on art with transparency over multicolored backgrounds. I ran a batch and my antialiasing is intact in the gifs.

    I'll still use the script for the non-white backgrounds.
    hitpawz@adobeforums.com Guest

  11. #11

    Default Re: Anti-Alias Cutoff

    Once you've outlined the stroke, you ought to be able to offset it by 4 pts, then give it a fill and stroke of None if you need transparency.

    To simplify your method more, you might be able to use a style sheet with a white stroke of 4 pts, to avoid clicking through the Stroke dialog box in AI10. With 1100 of these to do any little bit helps. (Create an object with 4-point white stroke, drag it onto the style palette. From then on just click on that style while your pasted elements are sellected.) I think the styles are doent independant, though, so it might not help any at this point, since these are all different doents.
    jonf@adobeforums.com Guest

  12. #12

    Default Re: Anti-Alias Cutoff

    Ah yes, good point. Outlining the stroke gives me the offset option. I'm adding all of this to a batch so I'm not too worried about the style because batching allows me to set the fill and stroke colors to nil.

    I'm so happy now. A bit disappointed that I didn't figure this out instantly, but hey. Everyone needs a jumpstart now and then :)

    Thanks again. Problem solved.
    hitpawz@adobeforums.com Guest

  13. #13

    Default Re: Anti-Alias Cutoff

    I no longer have Ill 10 here at work, so I can't test it, but changing-

    tell application "Illustrator CS"
    to
    tell application "Illustrator 10"

    should work without needing to change any other code.
    Jason_Howard@adobeforums.com Guest

Similar Threads

  1. Anti Alias for readability issue
    By theSchtickla in forum Macromedia Flash Player
    Replies: 0
    Last Post: February 13th, 12:40 AM
  2. flash anti-alias
    By bragabia in forum Macromedia Freehand
    Replies: 3
    Last Post: July 24th, 08:06 PM
  3. Basic Anti-Alias Questions
    By exingo@adobeforums.com in forum Adobe Photoshop Mac CS, CS2 & CS3
    Replies: 8
    Last Post: February 20th, 12:26 AM
  4. Anti alias vector images
    By Anton_FA webforumsuser@macromedia.com in forum Macromedia Freehand
    Replies: 11
    Last Post: December 5th, 05:47 PM
  5. Is it possible to anti alias the text in a field?
    By John Pub in forum Macromedia Director Lingo
    Replies: 1
    Last Post: September 12th, 03:37 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139