Question

When programing for Android using OpenGL I seem to be able use BMP, JPG and PNG file types for my images. Which (if any) is best? Many thanks.

Was it helpful?

Solution

This is not an OpenGL concern as once you have the Graphics.Bitmap object the source is largely irrelevant.

So this degenerates into essentially 'Which file format is better?' which can be answered in other questions such as What is the difference between “JPG” / “JPEG” / “PNG” / “BMP” / “GIF” / “TIFF” Image?

Ultimately I would suggest using a PNG. Why?

BMP images are (generally) uncompressed - they are exact representations of the image but can be very large in size.

PNG is a lossless compression format - when it is uncompressed, it is an exact representation of the image.

JPG is a lossy compression format - when it is uncompressed, it is not an exact representation and thus there may be visual artifacts.

So, both BMP and PNG result in an exact representation of the original image, while PNG files will be smaller in size which is important for mobile applications.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top