Artificial-intelligence-based image processing method and apparatus, electronic device, computer-readable storage medium, and computer program product
AssigneeTencent Technology (Shenzhen) Company Limited
InventorFasheng Chen
Life of this patent
Estimating the term…
Abstract
This application provides an artificial-intelligence-based image processing method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product. The method includes determining a background color in an image to be processed; determining a blending transparency of the pixel according to a chroma difference between a pixel and the background color in the image to be processed; obtaining a background image corresponding to the image to be processed; and performing in pixels an image blending process on the image to be processed and the background image according to the blending transparency of the pixel to obtain a composite image.
Claims20
An image processing method, performed by an electronic device, the method comprising:
- determining a background color in an image to be processed;
- for each of a plurality of pixels in the image to be processed:
- determining, according to a chroma difference between the pixel and the background color, a blending transparency of the pixel;
- determining a luminance difference between the pixel and the background color in the image to be processed;
- performing a weighting process on the luminance difference according to a shadow compensation parameter to obtain a shadow compensation intensity of the pixel;
- and
- performing a shadow compensation process on the blending transparency of the pixel according to the shadow compensation intensity of the pixel, comprising:
- increasing the blending transparency of the pixel according to the shadow compensation intensity, to obtain an increased blending transparency, and restricting the increased blending transparency according to a transparency range;
- obtaining a background image corresponding to the image to be processed, wherein the background image is different from the image to be processed and is determined based on an application scenario;
- and
- performing, in a pixel-by-pixel manner, an image blending process on the image to be processed and the background image according to the blending transparency of the pixel to obtain a composite image.
An electronic device, comprising:
- a memory, configured to store executable instructions;
- and
- a processor, configured to, when executing the executable instructions stored in the memory, implement:
- determining a background color in an image to be processed;
- for each of a plurality of pixels in the image to be processed:
- determining, according to a chroma difference between the pixel and the background color, a blending transparency of the pixel;
- determining a luminance difference between the pixel and the background color in the image to be processed;
- performing a weighting process on the luminance difference according to a shadow compensation parameter to obtain a shadow compensation intensity of the pixel;
- and
- performing a shadow compensation process on the blending transparency of the pixel according to the shadow compensation intensity of the pixel, comprising:
- increasing the blending transparency of the pixel according to the shadow compensation intensity, to obtain an increased blending transparency, and restricting the increased blending transparency according to a transparency range;
- obtaining a background image corresponding to the image to be processed, wherein the background image is different from the image to be processed and is determined based on an application scenario;
- and
- performing, in a pixel-by-pixel manner, an image blending process on the image to be processed and the background image according to the blending transparency of the pixel to obtain a composite image.
A non-transitory computer-readable storage medium, storing executable instructions, the executable instructions, when executed by a processor, causing the processor to implement:
- determining a background color in an image to be processed;
- for each of a plurality of pixels in the image to be processed:
- determining, according to a chroma difference between the pixel and the background color, a blending transparency of the pixel;
- determining a luminance difference between the pixel and the background color in the image to be processed;
- performing a weighting process on the luminance difference according to a shadow compensation parameter to obtain a shadow compensation intensity of the pixel;
- and
- performing a shadow compensation process on the blending transparency of the pixel according to the shadow compensation intensity of the pixel, comprising:
- increasing the blending transparency of the pixel according to the shadow compensation intensity, to obtain an increased blending transparency, and restricting the increased blending transparency according to a transparency range;
- obtaining a background image corresponding to the image to be processed, wherein the background image is different from the image to be processed and is determined based on an application scenario;
- and
- performing, in a pixel-by-pixel manner, an image blending process on the image to be processed and the background image according to the blending transparency of the pixel to obtain a composite image.
Dependencies are inferred from the claim text.