We will investigate ways of improving the documentation for these parameters. They can be a bit confusing without much context, but in short, they are included as a means of preventing out-of-memory errors when the images get loaded into memory from the camera.
Under the hood, when the user goes to take a picture, it actually loads up a separate Camera application. Once the image is captured, the picture is saved to the phone’s hard disk (instead of in-memory). The camera then calls back to your App with a reference to where that image was saved. At this point in time, that image on disk is the raw, unscaled image; these images can be quite large (several megapixels in most cases). Your application needs to load those images into memory in order to display them in on the screen (or perform some other action on them, such as base64 encoding). Although the image is saved on the device’s storage as a JPG or PNG (thus relatively small in file size), they get loaded into the application’s memory as a Bitmap. Bitmaps are uncompressed, thus consume a significantly larger portion of device memory (in some cases, hundreds of megabytes). This can pretty easily cause an application to crash due to out-of-memory errors if left unchecked.
So these parameters are included with the two actions “Pick an Image” and “Take a Photo”. The parameters don’t alter the image saved on disk; they simply alter the image as it is loaded into the application’s memory by downsampling the colors and scaling down the resolution.
The “Color Quality” parameter corresponds to inPreferredConfig. This setting will attempt to downsample the colors as they are loaded into memory, such that each pixel consumes less memory. “High Quality” translates to
ARGB_8888 and “Low Quality” translates to
The “Sample Size” parameter corresponds to inSampleSize. This setting will downscale the image such that the resolution is decreased when the image is loaded into memory. Values must be powers of 2 (and will be rounded accordingly if they’re not). For example, a value of
1 will maintain the raw image’s resolution. A value of
2 will scale the image in half. A value of
4 will scale the image into a quarter of its original size. A value of
7 will be rounded to
8 I believe, and will scale the image to 1/8 its original size.
Please let me know if you need any clarification on that!