This invention relates to the field of
image processing technology, specifically to a pixel
processing method, apparatus, device, and storage medium for images. The method includes: receiving image data of an original image captured by a sensor; dividing the n pixels into a first set and a second set by detecting whether n first pixel values are 0; determining a first virtual
black level in the first set based on the first pixel values, the true
black level, and the bit width; setting the
black level of each pixel in the second set to a second virtual black level; and statistically obtaining n virtual black levels corresponding to the n pixels;
cropping the n first pixel values to obtain n second pixel values; and performing post-
processing on the image using the n second pixel values to obtain the original image. After virtual black level
cropping, this method retains some pixel values that are not 0, preserving smaller values, thereby retaining
pixel color or detail in extremely dark areas and optimizing
image contrast and detail.