UIImage is responsible for loading image content.We only need 590KB to load a image, while we needĢ048 pixels x 1536 pixels x 4 bytes per pixel = 10MB when decoding Image Rendering Pipeline 1Ī image have load -> decode -> render these 3 phases. The range of each channel value is from 0 to 255, which needs 8 bits to represent the value. Because in sRGB, there are Red, Green, Blue 3 channels and Alpha. Take the following image as an instance, its file size is 590KB, with dimension 2048 x 1536 pixel.īy this article, each pixel in sRGB image needs 32bit, 4 bytes, in memory when it’s decoded. Memory use is related to the dimensions of the images, not the file size. The memory use of an image using sRGB space Consequently, your application, for every image that gets decoded, could have a persistent and large memory allocation hanging out.
A data buffer that contains an image file, typically, begins with some metadata describing the size of the image that’s stored in that data buffer. If we’ve downloaded images from the network or we’ve loaded them from disk. And that frame buffer provides per pixel color information that the display hardware will read in order to illuminate the pixels on the display.Ī data buffer is just a buffer that contains a sequence of bytes. The frame buffer is what holds the actual rendered output of your application.Īs your application updates its view hierarchy UIKit will render the application’s window and all of its subviews into the frame buffer.
The buffer size = 4 byte x image_width x image_height For example, in the image with sRBG format, each 32 bits describes the color and transparency of a single pixel. Constantly, the buffer size is proportional to image size. One kind of the important buffers is the Image Buffer, which holds the in-memory representation of some image.Įach element in image buffers describes the color and the transparency of single pixel in our image. It is often viewed as sequence of elements of the same sizes, usually of the same internal construction. But, if you application consumes too much memory, that causes more CPU utilization, which have negative effects on battery life and performance.It is obvious that too much usage of CPU has negative impact on battery life and responsiveness.Notes for wwdc2018/219 and wwdc2018/416 Why memory and CPU matter?