File formats

You can specify the file format of the resulting image that’s returned from tinySrc. You can choose either PNG or JPEG encoding. This parameter goes before the dimensions (if present) and the URL:

<img

src='http://i.tinysrc.mobi/jpg/http://mysite.com/myimage.png'

alt='My image'

/>

If not specified, tinySrc will decide on a suitable format based on the original image. PNGs and JPEGs will remain in the same format, and GIF images get converted to PNG.

If you override this behavior, the image will get converted when it is resized. In the example above, an original PNG is converted to a JPEG image.

Note that JPEG is a ‘lossy’ encoding, so the quality of a resized JPEG image will not necessarily be as good as the original PNG (although it should be smaller in file size).

Next.