Aha so that's how antialiasing in gif works..


  • admin

    In case you ever wondered what happens with antialiasing when saving to .gif:

    If you don't draw a solid background, the gif gets a 1-bit mask and that looks very pixely:

    size(100, 100)
    fill(0)
    oval(10, 10, 80, 80)
    saveImage("test_no_background.gif")
    

    test_no_background.gif

    If you do draw a background, the shape is antialised as expected:

    size(100, 100)
    fill(1)
    rect(0,0,width(),height())
    fill(0)
    oval(10, 10, 80, 80)
    saveImage("test_white_background.gif")!
    

    test_white_background.gif