Here the author is comparing two image compression formats, namely, the JPEG format and the GIF format:
The moral of this tale is that more often than not, you’ll want to retain as much photographic realism in your inline images as possible, and you’ll forgo a little extra file size for that privilege, whereas for your background images, you’ll likely need less realism and will be working with larger blocks of color or small gradient areas, and will therefore need the GIF format.
I know that the verb construction forgo something basically means to go without something but in the context of this big sentence, it doesn't really make much sense, if you think about it for a second. If you're using the JPEG format, you can't forgo a little extra file size (you will not go without it, on the contrary, you will go with it!) because JPEG image files are usually larger than the same images compressed with the GIF format. There must be something I'm missing.