![imagegif gif imagegif gif](http://cdn140.picsart.com/285130434006201.gif)
If you have a black and white image, you can certainly get away with a lossless gif image, but gifs are by no means "lossless". Some rectangles are certainly squares, nevertheless, the statement is, by logic, 100% false.
![imagegif gif imagegif gif](https://i.ytimg.com/vi/1DKbK417-dQ/maxresdefault.jpg)
This article flatly and falsely states "the Graphics Interchange File (GIF) is an image format used on the Web that provides lossless compression." That's like saying, "all rectangles are squares". Beyond that basic understanding, image compression is not the exact science that all these expert "bloggers" are promoting, and programmers will do well to study the data formats and compression algorithms in depth (pun intended), and on their own. A little bit of reason would also tell that almost EVERY image type that is not a bitmap is indeed lossy, otherwise we may as well just use the bitmap. Loss occurs at the point of save, not at the point of file open, and gif loss behaves differently jpegs loss, which is where people are getting confused. Many people are claiming gifs are lossless, which is not correct. Thanks to Mario, from this link for the first line above: Convert JPG/GIF image to PNG in PHP? Imagegif($img, $destination_filename) // $destination_filename is the location on your server where you want to save the compressed gif file Imagetruecolortopalette($img, false, 16) // compress to 16 colors in gif palette (change 16 to anything between 1-256) Here is the PHP code: $img = imagecreatefromstring(file_get_contents($_FILES)) Gifs certainly are lossy and you absolutely can compress them - quite significantly.