Search code examples
phpuse-casephp-gd

What is the use case for imageantialias($img, false)


I don't understand why in PHP when using the imageantialias function you need to pass in a Bool to say if you want to enable anti-aliasing or not.

It feels counter intuitive to call a function with a parameter to say don't do anything.

Is there a use case for calling it with false that I am missing?


Solution

  • Passing false doesn't tell the function to do nothing, but to turn antialiasing off, if it was on. A usecase would be drawing to an image with antialiasing, later wanting to draw some more without antialiasing.