Image processing method and device, equipment and medium
Patent Information
- Application Number
- CN202511456469.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-11
- Publication Date
- 2026-01-09
AI Technical Summary
In displaying dynamic images, existing technologies suffer from a problem where the colors of the displayed dynamic images do not match those captured by the image sensor due to mismatched color space conversion types.
Information indicating the second color space conversion type is written into the header of the dynamic image file. The dynamic image data is then converted and encoded using the first color space conversion type to ensure color consistency during decoding by using the correct color space conversion type.
It achieves consistency between the colors displayed in dynamic images and the colors acquired by the image sensor, ensuring the true reproduction of dynamic images.
Smart Images

Figure CN121309744A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of image processing, and particularly relates to an image processing method, device, equipment and medium. BACKGROUND
[0002] A dynamic image (Live Photo) refers to a visual form of continuous motion over time. It realizes dynamic transmission of information and visual attraction through continuous playing of multiple frames or transformation of dynamic elements. The dynamic image usually includes a cover image and a video.
[0003] In the related art, when a dynamic image is displayed, a dynamic image file corresponding to the dynamic image needs to be decoded, and image data obtained by decoding is subjected to color space conversion. However, when the type of color space conversion used for displaying the dynamic image does not correspond to the type of color space conversion used for generating the dynamic image file, the color of the displayed dynamic image will not be consistent with the color of the dynamic image collected by an image sensor. SUMMARY
[0004] The purpose of the embodiments of the present application is to provide an image processing method, device, equipment and medium, which can solve the problem that the color of the displayed dynamic image is inconsistent with the color of the dynamic image collected by an image sensor.
[0005] In a first aspect, the embodiments of the present application provide an image processing method, comprising: writing first information in a file header of a dynamic image file; wherein the dynamic image file is a file obtained by performing color space conversion and encoding on first RGB image data of a dynamic image in an RGB color space using a first color space conversion type, and the first information includes second color space conversion type information, the second color space conversion type information being used to indicate a second color space conversion type.
[0006] In a second aspect, the embodiments of the present application provide an image processing device, comprising: a writing module configured to write first information in a file header of a dynamic image file; wherein the dynamic image file is a file obtained by performing color space conversion and encoding on first RGB image data of a dynamic image in an RGB color space using a first color space conversion type, and the first information includes second color space conversion type information, the second color space conversion type information being used to indicate a second color space conversion type.
[0007] In a third aspect, the embodiments of the present application provide an electronic device, which includes a processor and a memory. The memory stores programs or instructions that can be run on the processor. When the programs or instructions are executed by the processor, the steps of the image processing method provided by the embodiments of the present application are implemented.
[0008] In a fourth aspect, an embodiment of the present application provides a readable storage medium, the readable storage medium storing a program or instructions, the program or instructions being executed by a processor to implement steps of the image processing method provided by the embodiments of the present application.
[0009] In a fifth aspect, an embodiment of the present application provides a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, and the processor being configured to run a program or instructions to implement steps of the image processing method provided by the embodiments of the present application.
[0010] In a sixth aspect, an embodiment of the present application provides a computer program product, the program product being stored in a storage medium, and the program product being executed by at least one processor to implement steps of the image processing method provided by the embodiments of the present application.
[0011] In the embodiments of the present application, after the dynamic image file is obtained by performing color space conversion and encoding on the first RGB image data of the dynamic image in the RGB color space by using the first color space conversion type, the second color space conversion type information indicating the second color space conversion type is written in the file header of the dynamic image file, and the second color space conversion type can be obtained after the dynamic image file is decoded. The YUV image data obtained by decoding the dynamic image file by using the second color space conversion type is subjected to color space conversion, so that the color of the displayed dynamic image is consistent with the color of the dynamic image collected by the image sensor, and the color of the dynamic image can be restored truly. BRIEF DESCRIPTION OF DRAWINGS
[0012] Figure 1 FIG. 1 is a flowchart of an image processing method provided by some embodiments of the present application; Figure 2 FIG. 2 is a schematic diagram of an overall flow of dynamic image processing provided by some embodiments of the present application; Figure 3 FIG. 3 is a schematic diagram of an implementation process of dynamic image processing provided by some embodiments of the present application; Figure 4 FIG. 4 is another schematic diagram of an overall flow of dynamic image processing provided by some embodiments of the present application; Figure 5 FIG. 5 is another schematic diagram of an implementation process of dynamic image processing provided by some embodiments of the present application; Figure 6 FIG. 6 is a structural schematic diagram of an image processing apparatus provided by some embodiments of the present application; Figure 7 FIG. 7 is a structural schematic diagram of an electronic device provided by some embodiments of the present application; Figure 8is a schematic diagram of a hardware structure of an electronic device provided by some embodiments of the present application. DETAILED DESCRIPTION
[0013] The technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art are within the scope of protection of the present application.
[0014] The terms "first", "second", and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a particular order or sequence. It should be understood that the terms used in this way can be interchanged, so that the embodiments of the present application can be implemented in an order other than that illustrated or described herein, and the objects distinguished by "first", "second", and the like are generally of a kind and are not limited in number, for example, the first object can be one or more. In addition, "and / or" in the specification and claims indicates at least one of the connected objects, and the character " / ", generally indicates that the objects before and after are in an "or" relationship.
[0015] The terms used in the embodiments of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. The terms related to the embodiments of the present application are explained below.
[0016] Color space, also known as color space or color space, is a color space that is described in a generally acceptable manner under certain standards. Commonly used color spaces include red-green-blue (RGB) color space, hue-saturation-value (HSV) color space, etc.
[0017] Color space conversion type is the conversion type used to convert one color space to another color space, for example, BT601_YUV2RGB, BT709_YUV2RGB, BT2020_YUV2RGB, BT709_RGB2YUV, etc.
[0018] File header refers to specific format information at the beginning of a file, which is used to describe file type, version, metadata, or copyright declaration, etc.
[0019] With the popularity of dynamic images, the problem of color consistency has also been exposed, mainly the problem of inconsistency between the cover of the dynamic image and the video color. The cover is usually a P3 color gamut photo, while the video is usually SRGB color gamut, and the color gamut of the two is different, which leads to the inconsistency of the color of the cover and the video. When displaying the dynamic image, the picture will appear color jump when playing from the static picture to the video. In order to prevent the picture from appearing color jump when playing from the static picture to the video when displaying the dynamic image, color management needs to be performed on the dynamic image.
[0020] In the related art, when color management is performed on the dynamic image, the dynamic image is calibrated to P3 color gamut. When the dynamic image is captured by using the camera of the electronic device, the original (RAW) image data collected by the image sensor is converted into RGB image data under the P3 color gamut, and then the RGB image data is converted into YUV image data by using the color space conversion formula corresponding to the pre-set RGB2YUV color space conversion type, and the YUV image data is encoded to obtain a dynamic image file. In order to make the dynamic image display the effect of P3 color gamut, it is necessary to write P3 color space parameters in the file header of the dynamic image file; wherein the P3 color space parameters are: DISPLAY_P3=STANDARD_DCI_P3|TRANSFER_SRGB|RANGE_FULL.
[0021] Among them, the STANDARD in the color space parameter is defined according to the CIE 1931 x and y definition in ISO 11664-1, which defines the chromaticity coordinates of the image source, including the vertex and white point coordinates. There are usually STANDARD_BT601, STANDARD_BT709, STANDARD_DCI_P3, STANDARD_BT2020, etc.; the TRANSFER in the color space parameter represents the transmission curve, also known as the gamma curve, such as TRANSFER_SRGB, TRANSFER_GAMMA2_2, etc.; the RANGE in the color space parameter defines the gray scale value range corresponding to the image source pixel point, and there are usually RANGE_FULL and RANGE_LIMIT, etc.
[0022] When displaying the dynamic image, the dynamic image file is decoded to obtain YUV image data, and a graphics processing unit (GPU) or a display processing unit (DPU) determines a color space conversion formula corresponding to a YUV2RGB color space conversion type according to the STANDARD in the color space parameter. However, there is no YUV2RGB color space conversion formula corresponding to STANDARD_DCI_P3, so when converting YUV image data to RGB image data, only one YUV2RGB can be selected from three YUV2RGB standard types "BT601_YUV2RGB, BT709_YUV2RGB, and BT2020_YUV2RGB" to convert the YUV image data, so as to prevent color jump from static image playing to video when displaying the dynamic image. However, if the selected YUV2RGB type does not correspond to the RGB2YUV type used when converting RGB image data to YUV image data, the color of the displayed dynamic image will not be consistent with the color of the dynamic image collected by the image sensor. For example, the RGB2YUV type used when converting RGB image data to YUV image data is BT601_RGB2YUV, and the YUV2RGB type used when converting YUV image data to RGB image data is BT709_YUV2RGB.
[0023] It should be noted that BT601_RGB2YUV corresponds to BT601_YUV2RGB, BT709_RGB2YUV corresponds to BT709_YUV2RGB, and BT2020_RGB2YUV corresponds to BT2020_YUV2RGB.
[0024] To solve the problem that the color of the displayed dynamic image is inconsistent with the color of the dynamic image collected by the image sensor, the embodiments of the present application provide an image processing method, device, equipment and medium.
[0025] The image processing method, device, equipment and medium provided by the embodiments of the present application will be described in detail below in combination with the drawings, specific embodiments and application scenarios.
[0026] It should be noted that the image processing method provided by the embodiments of the present application can be executed by a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, or the like. In some embodiments of the present application, the image processing method is executed by an electronic device as an execution subject, and the image processing method provided by the embodiments of the present application is described.
[0027] Figure 1 is a flowchart of the image processing method provided by some embodiments of the present application. The image processing method comprises: Step 101: writing first information in a file header of a dynamic image file; wherein the dynamic image file is a file obtained by performing color space conversion and encoding on first RGB image data of a dynamic image in an RGB color space using a first color space conversion type, and the first information includes second color space conversion type information used for indicating a second color space conversion type.
[0028] In some embodiments of the present application, when a dynamic image is captured by using a camera of an electronic device, a RAW image data collected by an image sensor is converted into RGB image data in a P3 color gamut, and then the RGB image data is converted into YUV image data by using a color space conversion formula corresponding to the first color space conversion type, and the YUV image data is encoded to obtain a dynamic image file. After obtaining the dynamic image file, second color space conversion type information used for indicating the second color space conversion type is written in a file header of the dynamic image file.
[0029] In some embodiments of the present application, the second color space conversion type in the embodiments of the present application is the color space conversion type corresponding to the first color space conversion type.
[0030] Exemplarily, the first color space conversion type is BT601_YUV2RGB, and the second color space conversion type is BT601_YUV2RGB; the first color space conversion type is BT709_YUV2RGB, and the second color space conversion type is BT709_YUV2RGB; the first color space conversion type is BT2020_YUV2RGB, and the second color space conversion type is BT2020_YUV2RGB.
[0031] In some embodiments of the present application, in the case that a color gamut corresponding to the first color space conversion type is smaller than a source color gamut of the dynamic image, the first information includes P3 color space parameter information and the second color space conversion type information; wherein the source color gamut of the dynamic image is a P3 color gamut.
[0032] In some embodiments of the present application, the first color space conversion type is BT601_RGB2YUV, and the second color space conversion type is BT601_YUV2RGB; or, the first color space conversion type is BT709_RGB2YUV, and the second color space conversion type is BT709_YUV2RGB.
[0033] Exemplarily, when the first color space conversion type is BT601_RGB2YUV, the color gamut corresponding to the first color space conversion type is BT601 color gamut, the BT601 color gamut is smaller than the P3 color gamut, at this time, the P3 color space parameter information and the color space conversion type information corresponding to BT601_YUV2RGB are written in the file header of the dynamic image file.
[0034] Exemplarily, when the first color space conversion type is BT709_RGB2YUV, the color gamut corresponding to the first color space conversion type is BT709 color gamut, the BT709 color gamut is smaller than the P3 color gamut, at this time, the P3 color space parameter information and the color space conversion type information corresponding to BT709_YUV2RGB are written in the file header of the dynamic image file.
[0035] The P3 color space parameter information can be: DISPLAY_P3 = STANDARD_DCI_P3 | TRANSFER_SRGB | RANGE_FULL.
[0036] In some embodiments of the present application, in the case that the color gamut corresponding to the first color space conversion type is greater than the source color gamut of the dynamic image, the first information includes the second color space conversion type information and the P3 color gamut parameter; the second color space conversion type information is the color space parameter corresponding to the second color space conversion type, and the source color gamut of the dynamic image is the P3 color gamut.
[0037] In some embodiments of the present application, the first color space conversion type is BT2020_RGB2YUV, and the second color space conversion type is BT2020_YUV2RGB.
[0038] Exemplarily, when the first color space conversion type is BT2020_RGB2YUV, the color gamut corresponding to the first color space conversion type is BT2020 color gamut, the BT2020 color gamut is greater than the P3 color gamut, at this time, the BT2020 color space parameter information and the P3 color gamut parameter are written in the file header of the dynamic image file.
[0039] The BT2020 color space parameter information can be: DISPLAY_BT2020 = STANDARD_BT2020 | TRANSFER_SRGB | RANGE_FULL.
[0040] In some embodiments of the present application, when the first color space conversion type is BT2020_RGB2YUV, before step 101, the image processing method provided by the embodiments of the present application can further include: converting the RGB image data in the P3 gamut from the P3 gamut to the BT2020 gamut to obtain the first RGB image data, before the first RGB image data is color space converted by using the first color space conversion type.
[0041] In some embodiments of the present application, the image processing method provided by the embodiments of the present application can further include: decoding the dynamic image file to obtain YUV image data of the dynamic image in the YUV color space and second color space conversion type information; performing color space conversion on the YUV image data according to the second color space conversion type indicated by the second color space conversion type information to obtain the first RGB image data; and displaying the dynamic image according to the first RGB image data.
[0042] In some embodiments of the present application, the YUV image data of the dynamic image in the YUV color space and the second color space conversion type information can be obtained by decoding the dynamic image file. The specific process of decoding the dynamic image file can refer to the description in the related art, which will not be described here in detail by the embodiments of the present application.
[0043] When the file header of the dynamic image file is written with the P3 color space parameter information and the second color space conversion type information, for example, the file header of the dynamic image file is written with DISPLAY_P3=STANDARD_DCI_P3|TRANSFER_SRGB|RANGE_FULL and BT601_YUV2RGB, the second color space conversion type can be obtained as BT601_YUV2RGB by analyzing the BT601_YUV2RGB when the dynamic image file is parsed; for another example, the file header of the dynamic image file is written with DISPLAY_P3=STANDARD_DCI_P3|TRANSFER_SRGB|RANGE_FULL and BT709_YUV2RGB, the second color space conversion type can be obtained as BT709_YUV2RGB by analyzing the BT709_YUV2RGB when the dynamic image file is parsed.
[0044] When the file header of the dynamic image file is written with the color space parameter and the P3 gamut parameter corresponding to the second color space conversion type, for example, the file header of the dynamic image file is written with DISPLAY_BT2020=STANDARD_BT2020|TRANSFER_SRGB|RANGE_FULL and the P3 gamut parameter, when the dynamic image file is parsed, the STANDARD_BT2020 can be obtained through DISPLAY_BT2020=STANDARD_BT2020|TRANSFER_SRGB|RANGE_FULL, and then the second color space conversion type is determined to be BT2020_YUV2RGB according to the STANDARD_BT2020.
[0045] When the dynamic image file is decoded to obtain the YUV image data of the dynamic image in the YUV color space and the second color space conversion type information, the YUV image data is color space converted according to the second color space conversion type indicated by the second color space conversion type information, to obtain the first RGB image data.
[0046] Exemplarily, assuming that the second color space conversion type indicated by the second color space conversion type information is BT601_YUV2RGB, the YUV image data is color space converted by using the color space conversion formula corresponding to BT601_YUV2RGB, to obtain the RGB image data.
[0047] Exemplarily, assuming that the second color space conversion type indicated by the second color space conversion type information is BT2020_YUV2RGB, the YUV image data is color space converted by using the color space conversion formula corresponding to BT2020_YUV2RGB, to obtain the RGB image data.
[0048] In some possible implementations of the present application, the YUV image data is color space converted according to the second color space conversion type indicated by the second color space conversion type information, to obtain the first RGB image data can include: in the case that the implementation type of the application for displaying the dynamic image is TextureView or GLSurfaceView, calling a graphic processing unit (GPU) to color space convert the YUV image data according to the second color space conversion type, to obtain the first RGB image data; in the case that the implementation type of the application for displaying the dynamic image is SurfaceView, calling a display processing unit (DPU) to color space convert the YUV image data according to the second color space conversion type, to obtain the first RGB image data.
[0049] When the implementation type of the application displaying the dynamic image is SurfaceView, the YUV image data is sent to the DPU image composition unit, the DPU image composition unit performs color space conversion on the YUV image data by using the second color space conversion type to obtain RGB image data; when the implementation type of the application displaying the dynamic image is TextureView or GLSurfaceView, the YUV image data is sent to the GPU, and the GPU performs color space conversion on the YUV image data by using the second color space conversion type to obtain RGB image data.
[0050] In some embodiments of the present application, the implementation type of the application includes TextureView, GLSurfaceView and SurfaceView; wherein TextureView, GLSurfaceView and SurfaceView are rendering view classes; TextureView combines the high-efficiency rendering capability of SurfaceView and the flexibility of the view (View) system, supports complete View transformation (such as rotation, scaling, transparency, etc.), and is suitable for multimedia rendering scenarios that require dynamic effects and view transformation; GLSurfaceView is a view class optimized for OpenGL ES rendering, which inherits from SurfaceView, simplifies the initialization and rendering process of OpenGL ES, and has built-in embedded system graphics library (Embedded System Graphics Library, EGL) context management and rendering threads, and is suitable for developing two-dimensional or three-dimensional graphics applications, games, filter processing and other high-performance graphics scenarios; SurfaceView is used for efficiently drawing graphics or video in an independent thread, and is suitable for high-performance rendering scenarios such as video playback, games, camera preview, etc.
[0051] In some possible implementations of the present application, after obtaining the first RGB image data, the first RGB image data is sent to the layer composition module in the DPU image composition unit to be composed with other layers into a P3 gamut RGB image displayed on the screen.
[0052] The screen can only display RGB images, and its input is obtained by layer composition by the layer composition module in the DPU image composition unit. The layer is the input of the layer composition module, and the DPU composes multiple layers into a complete RGB image according to a certain order, and the number of layers varies with the change of the displayed scene. There can be multiple applications in a display screen, such as a video playback application, a status bar application, etc.; one application corresponds to at least one layer, and some applications have multiple layers, such as a video layer, a UI control layer, etc.
[0053] In the embodiments of the present application, after the first color space conversion type is used to perform color space conversion and encoding on the first RGB image data of the dynamic image in the RGB color space, the second color space conversion type information is written into the file header of the dynamic image file to indicate the second color space conversion type. When the dynamic image file is decoded, the second color space conversion type can be obtained, and the YUV image data obtained by decoding the dynamic image file using the second color space conversion type is converted in color space. The color of the displayed dynamic image is consistent with the color of the dynamic image collected by the image sensor, and the color of the dynamic image can be truly restored.
[0054] In some possible implementations of the present application, before the dynamic image is displayed according to the first RGB image data, the image processing method provided by the embodiments of the present application can further include: in the case where the color gamut corresponding to the first color space conversion type is the BT2020 color gamut, converting the first RGB image data from the BT2020 color gamut to the P3 color gamut to obtain second RGB image data; and correspondingly, displaying the dynamic image according to the first RGB image data includes: displaying the dynamic image according to the second RGB image data.
[0055] Exemplarily, when the second color space conversion type is BT2020_YUV2RGB, the color gamut of the obtained first RGB image data is the BT2020 color gamut, the first RGB image data is converted from the BT2020 color gamut to the P3 color gamut to obtain the second RGB image data, and the second RGB image data is sent to the layer synthesis module in the DPU image synthesis unit to be synthesized with other layers into an RGB image in the P3 color gamut for display on the screen.
[0056] In some embodiments of the present application, the image processing method provided by the embodiments of the present application can further include: in the case where the second color space conversion type information fails to be written into the file header or the second color space conversion type information is not obtained by decoding the dynamic image file, performing color space conversion on the YUV image data according to BT709_YUV2RGB to obtain RGB image data; wherein the YUV image data is the YUV image data obtained by decoding the dynamic image file.
[0057] Figure 2 is a whole flow diagram of dynamic image processing provided by some embodiments of the present application. The whole flow of dynamic image processing includes the following steps: Step 201: obtaining RAW image data collected by an image sensor; Step 202: converting the RAW image data into RGB image data in the P3 color gamut; Step 203: converting the RGB image data into YUV image data by using a color space conversion mode corresponding to BTxxx_RGB2YUV; wherein BTxxx_RGB2YUV is BT601_RGB2YUV or BT709_RGB2YUV; Step 204: encoding the YUV image data to obtain a dynamic image file; Step 205: writing P3 color space parameter information and BTxxx_YUV2RGB into a file header of the dynamic image file, and storing the dynamic image file; when BTxxx_RGB2YUV is BT601_RGB2YUV, BTxxx_YUV2RGB is BT601_YUV2RGB; when BTxxx_RGB2YUV is BT709_RGB2YUV, BTxxx_YUV2RGB is BT709_YUV2RGB; Step 206: after receiving a first input of an identification of the dynamic image file, decoding the dynamic image file to obtain YUV image data and BTxxx_YUV2RGB; In some embodiments of the present application, the first input in the embodiments of the present application is an input for triggering display of the dynamic image. The first input in the embodiments of the present application includes but is not limited to a touch input of a user on the dynamic image file identification by a touch device such as a finger or a stylus, a voice input or a gesture input, etc.; wherein the touch input includes but is not limited to a click input, a sliding input, etc., the click input can be a single click input, a double click input or any number of click inputs, and can also be a long press input or a short press input. The first input in the embodiments of the present application can be set and adaptively modified according to actual needs.
[0058] When the dynamic image file is a dynamic image file stored in a photo album of an electronic device, the dynamic image file identification can be an icon of the dynamic image file; when the dynamic image file is a dynamic image file sent by some application of another electronic device, the dynamic image file identification can be a cover image of the dynamic image.
[0059] Step 207: determining whether the dynamic image needs GPU rendering, if yes, executing step 208, if no, executing step 209; In some embodiments of the present application, it can be determined whether the implementation type of an application used for displaying the dynamic image is SurfaceView, if yes, it indicates that the dynamic image does not need GPU rendering, if no, it indicates that the dynamic image needs GPU rendering; Step 208: send the YUV image data to the GPU, the GPU converts the YUV image data into RGB image data by using the color space conversion mode corresponding to BTxxx_YUV2RGB, and sends the RGB image data to the layer synthesis module in the DPU image synthesis unit; Step 209: send the YUV image data to the DPU, the DPU converts the YUV image data into RGB image data by using the color space conversion mode corresponding to BTxxx_YUV2RGB, and sends the RGB image data to the layer synthesis module in the DPU image synthesis unit; Step 210: the layer synthesis module synthesizes the RGB image data and other layers into a P3 color gamut RGB image displayed on the screen.
[0060] Figure 3 is a schematic diagram of an embodiment process of dynamic image processing provided by some embodiments of the present application.
[0061] In Figure 3 , the dynamic image collected by the image sensor is calibrated according to P3, that is, the RAW image data collected by the image sensor is converted into P3 color gamut RGB image data; the RGB image data is converted into YUV image data by using the color space conversion mode corresponding to BTxxx_RGB2YUV; wherein BTxxx_RGB2YUV is BT601_RGB2YUV or BT709_RGB2YUV; the YUV image data is encoded to obtain a dynamic image file; the file header of the dynamic image file is written as DISPLAY_P3=STANDARD_DCI_P3|TRANSFER_SRGB|RANGE_FULL and BTxxx_YUV2RGB, and the dynamic image file is stored; the dynamic image file is decoded to obtain YUV image data and BTxxx_YUV2RGB; when the dynamic image does not need GPU rendering, the YUV image data is sent to the DPU, the DPU converts the YUV image data into P3 color gamut RGB image data by using the color space conversion mode corresponding to BTxxx_YUV2RGB, and sends the P3 color gamut RGB image data to the layer synthesis module in the DPU image synthesis unit; the layer synthesis module synthesizes the RGB image data and other layers into a P3 color gamut RGB image displayed on the screen; when the dynamic image needs GPU rendering, the YUV image data is sent to the GPU, the GPU converts the YUV image data into P3 color gamut RGB image data by using the color space conversion mode corresponding to BTxxx_YUV2RGB, and sends the P3 color gamut RGB image data to the layer synthesis module in the DPU image synthesis unit; the layer synthesis module synthesizes the RGB image data and other layers into a P3 color gamut RGB image displayed on the screen.
[0062] Figure 4 is another overall flow diagram of dynamic image processing provided by some embodiments of the present application. The overall flow of dynamic image processing includes the following steps: Step 401: obtaining RAW image data collected by an image sensor; Step 402: converting the RAW image data into RGB image data of P3 color gamut; Step 403: converting the RGB image data of P3 color gamut into RGB image data of BT2020 color gamut; Step 404: converting the RGB image data of BT2020 color gamut into YUV image data by using the color space conversion mode corresponding to BT2020_RGB2YUV; Step 405: encoding the YUV image data to obtain a dynamic image file; Step 406: writing BT2020 color space parameters and P3 color gamut parameters into the file header of the dynamic image file, and storing the dynamic image file; Step 407: after receiving a first input of an identification of the dynamic image file, decoding the dynamic image file to obtain YUV image data, BT2020 color space parameters and P3 color gamut parameters; Step 408: determining whether the dynamic image needs GPU rendering, if yes, executing Step 409, and if no, executing Step 410; In some embodiments of the present application, it can be determined whether the implementation type of the application for displaying the dynamic image is SurfaceView, if yes, it indicates that the dynamic image does not need GPU rendering, and if no, it indicates that the dynamic image needs GPU rendering; Step 409: sending the YUV image data to GPU, and GPU converts the YUV image data into RGB image data of BT2020 color gamut by using the color space conversion mode corresponding to BT2020_YUV2RGB, converts the RGB image data of BT2020 color gamut into RGB image data of P3 color gamut, and sends the RGB image data of P3 color gamut to the layer composition module in the DPU image composition unit; Step 410: sending the YUV image data to DPU, and DPU converts the YUV image data into RGB image data of BT2020 color gamut by using the color space conversion mode corresponding to BT2020_YUV2RGB, converts the RGB image data of BT2020 color gamut into RGB image data of P3 color gamut, and sends the RGB image data of P3 color gamut to the layer composition module in the DPU image composition unit; Step 411: The layer composition module composes the P3 gamut RGB image data and other layers into a P3 gamut RGB image and displays on the screen.
[0063] Figure 5 is another implementation process schematic diagram of dynamic image processing provided by some embodiments of the present application.
[0064] In Figure 5 , the dynamic image collected by the image sensor is calibrated according to P3, that is, the RAW image data collected by the image sensor is converted into P3 gamut RGB image data; the P3 gamut RGB image data is converted into BT2020 gamut RGB image data; the BT2020 gamut RGB image data is converted into YUV image data by using the corresponding color space conversion mode of BT2020_RGB2YUV; the YUV image data is encoded to obtain a dynamic image file; the file header of the dynamic image file is written with the BT2020 color space parameters and the P3 gamut parameters, and the dynamic image file is stored; the dynamic image file is decoded to obtain the YUV image data, the BT2020 color space parameters and the P3 gamut parameters; when the dynamic image does not need GPU rendering, the YUV image data is sent to the DPU, the DPU converts the YUV image data into RGB image data by using the corresponding color space conversion mode of BT2020_YUV2RGB to obtain the BT2020 gamut RGB image data, converts the BT2020 gamut RGB image data into P3 gamut RGB image data, and sends the P3 gamut RGB image data to the layer composition module in the DPU image composition unit; the layer composition module composes the RGB image data and other layers into a P3 gamut RGB image and displays on the screen; when the dynamic image needs GPU rendering, the YUV image data is sent to the GPU, the GPU converts the YUV image data into RGB image data by using the corresponding color space conversion mode of BT2020_YUV2RGB to obtain the BT2020 gamut RGB image data, converts the BT2020 gamut RGB image data into P3 gamut RGB image data, and sends the P3 gamut RGB image data to the layer composition module in the DPU image composition unit; the layer composition module composes the RGB image data and other layers into a P3 gamut RGB image and displays on the screen.
[0065] Figure 2 to Figure 5 The implementation process of each step of the dynamic image processing shown can refer to the description in the above embodiments, and the embodiments of the present application will not be described here.
[0066] The image processing method provided in the embodiments of the present application can be executed by an image processing device. The image processing device provided in the embodiments of the present application is described by taking the image processing device executing the image processing method as an example.
[0067] Figure 6 FIG. 1 is a structural schematic diagram of an image processing device provided in some embodiments of the present application; the image processing device 600 can include: The writing module 601 is configured to write first information in a file header of a dynamic image file; the dynamic image file is a file obtained by performing color space conversion and encoding on first RGB image data of a dynamic image in an RGB color space by using a first color space conversion type, and the first information includes second color space conversion type information, which is used to indicate a second color space conversion type.
[0068] In some embodiments of the present application, in a case where a color gamut corresponding to the first color space conversion type is smaller than a source color gamut of the dynamic image, the first information includes P3 color space parameter information and the second color space conversion type information; and the source color gamut of the dynamic image is a P3 color gamut.
[0069] In some embodiments of the present application, the first color space conversion type is BT601_RGB2YUV, and the second color space conversion type is BT601_YUV2RGB; or, the first color space conversion type is BT709_RGB2YUV, and the second color space conversion type is BT709_YUV2RGB.
[0070] In some embodiments of the present application, in a case where a color gamut corresponding to the first color space conversion type is greater than a source color gamut of the dynamic image, the first information includes second color space conversion type information and P3 color gamut parameters; the second color space conversion type information is color space parameters corresponding to the second color space conversion type, and the source color gamut of the dynamic image is a P3 color gamut.
[0071] In some embodiments of the present application, the first color space conversion type is BT2020_RGB2YUV, and the second color space conversion type is BT2020_YUV2RGB.
[0072] In some embodiments of the present application, the image processing device provided in the embodiments of the present application further includes: The decoding module is configured to decode the dynamic image file to obtain YUV image data of the dynamic image in a YUV color space and the second color space conversion type information. The first color space conversion module is configured to perform color space conversion on the YUV image data according to the second color space conversion type indicated by the second color space conversion type information to obtain the first RGB image data. a display module, configured to display the dynamic image according to the first RGB image data.
[0073] In some embodiments of the present application, the image processing apparatus provided by the embodiments of the present application further comprises: The first color gamut conversion module is configured to, in a case where the color gamut corresponding to the first color space conversion type is BT2020 color gamut, convert the first RGB image data from BT2020 color gamut to P3 color gamut to obtain second RGB image data. Correspondingly, the display module is specifically configured to: display the dynamic image according to the second RGB image data.
[0074] In some embodiments of the present application, the image processing apparatus provided by the embodiments of the present application further comprises: The second color gamut conversion module is configured to, before the first RGB image data is color space converted by using the first color space conversion type, convert the second RGB image data from P3 color gamut to BT2020 color gamut to obtain the first RGB image data.
[0075] In some embodiments of the present application, the first color gamut conversion module is specifically configured to: In a case where the implementation type of the application for displaying the dynamic image is TextureView or GLSurfaceView, the first color gamut conversion module is configured to call the graphic processing unit to perform color space conversion on the YUV image data according to the second color space conversion type to obtain the first RGB image data.
[0076] In some embodiments of the present application, the first color gamut conversion module is specifically configured to: In a case where the implementation type of the application for displaying the dynamic image is SurfaceView, the first color gamut conversion module is configured to call the display processing unit to perform color space conversion on the YUV image data according to the second color space conversion type to obtain the first RGB image data.
[0077] In some embodiments of the present application, the image processing apparatus provided by the embodiments of the present application further comprises: The second color space conversion module is configured to, in a case where the writing of the second color space conversion type information into the file header fails or the decoding of the dynamic image file does not obtain the second color space conversion type information, perform color space conversion on the YUV image data according to BT709_YUV2RGB to obtain RGB image data; wherein the YUV image data is YUV image data obtained by decoding the dynamic image file.
[0078] The image processing apparatus in the embodiments of the present application can be an electronic device or a component in an electronic device, for example, an integrated circuit or a chip. The electronic device can be a terminal or other device than a terminal. For example, the electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The electronic device can also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiments of the present application are not limited in this regard.
[0079] The image processing apparatus in the embodiments of the present application can be a device with an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating system. The embodiments of the present application are not limited in this regard.
[0080] The image processing apparatus provided by the embodiments of the present application can implement the image processing method Figure 1 to Figure 5 The image processing method provided by the embodiments of the present application can implement the image processing method
[0081] Optionally, as shown in Figure 7 The embodiments of the present application also provide an electronic device 700, which includes a processor 701 and a memory 702. The memory 702 stores programs or instructions that can be run on the processor 701. When the programs or instructions are executed by the processor 701, the programs or instructions implement each step of the image processing method provided by the embodiments of the present application and achieve the same technical effects. To avoid repetition, the details are not described here.
[0082] Figure 8 FIG. 1 is a hardware structure schematic diagram of an electronic device provided by some embodiments of the present application.
[0083] The electronic device 800 includes, but is not limited to, a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, and a processor 810, etc.
[0084] Those skilled in the art can understand that the electronic device 800 can also include a power supply (such as a battery) for supplying power to each component, and the power supply can be logically connected to the processor 810 through a power management system, so that the power management system can realize the functions of managing charging, discharging, and power consumption management. Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device can include more or fewer components than the figure, or combine certain components, or different component arrangements, which are not described here.
[0085] The processor 810 is configured to write first information in a file header of a dynamic image file; the dynamic image file is a file obtained by performing color space conversion and encoding on first RGB image data of a dynamic image in an RGB color space using a first color space conversion type, and the first information includes second color space conversion type information, and the second color space conversion type information is used to indicate a second color space conversion type.
[0086] In some embodiments of the present application, in the case where the color gamut corresponding to the first color space conversion type is smaller than the source color gamut of the dynamic image, the first information includes P3 color space parameter information and the second color space conversion type information; and the source color gamut of the dynamic image is a P3 color gamut.
[0087] In some embodiments of the present application, the first color space conversion type is BT601_RGB2YUV, and the second color space conversion type is BT601_YUV2RGB; or, the first color space conversion type is BT709_RGB2YUV, and the second color space conversion type is BT709_YUV2RGB.
[0088] In some embodiments of the present application, in the case where the color gamut corresponding to the first color space conversion type is greater than the source color gamut of the dynamic image, the first information includes second color space conversion type information and P3 color gamut parameters; the second color space conversion type information is color space parameters corresponding to the second color space conversion type, and the source color gamut of the dynamic image is a P3 color gamut.
[0089] In some embodiments of the present application, the first color space conversion type is BT2020_RGB2YUV, and the second color space conversion type is BT2020_YUV2RGB.
[0090] In some embodiments of the present application, the processor 810 is further configured to decode the dynamic image file to obtain YUV image data of the dynamic image in a YUV color space and the second color space conversion type information; and perform color space conversion on the YUV image data according to the second color space conversion type indicated by the second color space conversion type information to obtain the first RGB image data. The display unit 806 is configured to display the dynamic image according to the first RGB image data.
[0091] In some embodiments of the present application, the processor 810 is further configured to, in a case where the color gamut corresponding to the first color space conversion type is BT2020 color gamut, convert the first RGB image data from the BT2020 color gamut to the P3 color gamut to obtain second RGB image data. Correspondingly, the display unit 806 is specifically configured to: display the dynamic image according to the second RGB image data.
[0092] In some embodiments of the present application, the processor 810 is further configured to, before performing the color space conversion on the first RGB image data by using the first color space conversion type, convert the second RGB image data from the P3 color gamut to the BT2020 color gamut to obtain the first RGB image data.
[0093] In some embodiments of the present application, the processor 810 is specifically configured to: in a case where the implementation type of the application used for displaying the dynamic image is TextureView or GLSurfaceView, call the graphic processor to perform the color space conversion on the YUV image data according to the second color space conversion type to obtain the first RGB image data.
[0094] In some embodiments of the present application, the processor 810 is specifically configured to: in a case where the implementation type of the application used for displaying the dynamic image is SurfaceView, call the display processing unit to perform the color space conversion on the YUV image data according to the second color space conversion type to obtain the first RGB image data.
[0095] In some embodiments of the present application, the processor 810 is further configured to, in a case where the writing of the second color space conversion type information into the file header fails or the decoding of the dynamic image file does not obtain the second color space conversion type information, perform the color space conversion on the YUV image data according to BT709_YUV2RGB to obtain RGB image data; wherein the YUV image data is YUV image data obtained by decoding the dynamic image file.
[0096] It should be understood that in the embodiments of the present application, the input unit 804 can include a graphics processing unit (GPU) 8041 and a microphone 8042. The graphics processing unit 8041 processes image data of a still picture or a video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 806 can include a display panel 8061, which can be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 807 includes at least one of a touch panel 8071 and other input devices 8072. The touch panel 8071 is also referred to as a touch screen. The touch panel 8071 can include two parts of a touch detection device and a touch controller. The other input devices 8072 can include, but are not limited to, a physical keyboard, function keys (such as volume control keys, on-off keys, etc.), a trackball, a mouse, a joystick, and the like, which will not be described here.
[0097] The memory 809 can be used to store software programs and various data. The memory 809 can mainly include a first storage area storing programs or instructions and a second storage area storing data; wherein the first storage area can store an operating system, application programs or instructions required by at least one function (such as a sound playing function, an image playing function, etc.), etc. In addition, the memory 809 can include a volatile memory or a non-volatile memory, or the memory 809 can include both volatile and non-volatile memories. The non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM) or a flash memory. The volatile memory can be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (Direct Rambus RAM, DRRAM). The memory 809 in the embodiments of the present application includes but is not limited to these and any other suitable types of memory.
[0098] The processor 810 can include one or more processing units; optionally, the processor 810 integrates an application processor and a modem processor; wherein the application processor mainly processes operations related to operating systems, user interfaces, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 810.
[0099] The embodiment of the present application further provides a readable storage medium, and the readable storage medium stores a program or instructions, the program or instructions are executed by a processor to realize various processes of the image processing method provided by the embodiment of the present application, and the same technical effects can be achieved. To avoid repetition, details are not described here.
[0100] The processor is the processor in the electronic device in the above-mentioned embodiments. The readable storage medium includes a computer readable storage medium, such as a computer readable only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0101] The embodiment of the present application further provides a chip, and the chip includes a processor and a communication interface, the communication interface is coupled with the processor, and the processor is used to run a program or instructions to realize various processes of the image processing method provided by the embodiment of the present application, and the same technical effects can be achieved. To avoid repetition, details are not described here.
[0102] It should be understood that the chip mentioned in the embodiment of the present application can also be referred to as a system level chip, a system chip, a chip system or a system on chip, etc.
[0103] The embodiment of the present application further provides a computer program product, and the program product is stored in a storage medium, and the program product is executed by at least one processor to realize various processes of the image processing method provided by the embodiment of the present application, and the same technical effects can be achieved. To avoid repetition, details are not described here.
[0104] It should be noted that, in the present document, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element. Furthermore, it is to be understood that the method and apparatus of the present application can be carried out by more than one process, method, article, or apparatus either simultaneously, concurrently, or with intervening action that are carried out at the same time, either in a simultaneous fashion or in a fashion that is interleaved in time. For example, the described methods can be performed in a different order from that described, and / or various steps can be combined or omitted, and / or additional steps can be added, without departing from the scope of the present application. Also, features described with respect to certain examples can be combined in other examples.
[0105] From the above description of the embodiments, it is apparent that the above-described method of the embodiments can be realized by means of software and general-purpose hardware platforms, and of course, can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such an understanding, the technical solutions of the present application can be embodied in the form of a computer software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk), and includes a plurality of instructions for causing a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the method described in each embodiment of the present application.
[0106] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-described specific embodiments, and the above-described specific embodiments are merely illustrative, rather than limiting, and those of ordinary skill in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the scope protected by the claims, which all belong to the protection of the present application.
Claims
1. An image processing method, characterized by, The method comprises: writing first information in a file header of a dynamic image file; wherein the dynamic image file is a file obtained by performing color space conversion and encoding on first RGB image data of a dynamic image in an RGB color space using a first color space conversion type, and the first information comprises second color space conversion type information used for indicating a second color space conversion type.
2. The method of claim 1, wherein, in a case where a color gamut corresponding to the first color space conversion type is smaller than a source color gamut of the dynamic image, the first information comprises P3 color space parameter information and the second color space conversion type information; wherein the source color gamut of the dynamic image is a P3 color gamut.
3. The method of claim 2, wherein, the first color space conversion type is BT601_RGB2YUV, and the second color space conversion type is BT601_YUV2RGB; or the first color space conversion type is BT709_RGB2YUV, and the second color space conversion type is BT709_YUV2RGB.
4. The method of claim 1, wherein, in a case where a color gamut corresponding to the first color space conversion type is larger than a source color gamut of the dynamic image, the first information comprises the second color space conversion type information and P3 color gamut parameters; wherein the second color space conversion type information is color space parameters corresponding to the second color space conversion type, and the source color gamut of the dynamic image is a P3 color gamut.
5. The method of claim 4, wherein, the first color space conversion type is BT2020_RGB2YUV, and the second color space conversion type is BT2020_YUV2RGB.
6. The method according to any one of claims 1 to 5, characterized in that, The method further comprises: decoding the dynamic image file to obtain YUV image data of the dynamic image in a YUV color space and the second color space conversion type information; performing color space conversion on the YUV image data according to the second color space conversion type indicated by the second color space conversion type information to obtain the first RGB image data; displaying the dynamic image according to the first RGB image data.
7. The method of claim 6, wherein, Before the displaying of the dynamic image according to the first RGB image data, the method further comprises: in a case where a color gamut corresponding to the first color space conversion type is a BT2020 color gamut, converting the first RGB image data from the BT2020 color gamut to a P3 color gamut to obtain second RGB image data; the displaying of the dynamic image according to the first RGB image data comprises: displaying the dynamic image according to the second RGB image data.
8. The method of claim 7, wherein, Before the writing of the first information in the file header of the dynamic image file, the method further comprises: Before the first RGB image data is color space converted by using the first color space conversion type, the second RGB image data is converted from the P3 color gamut to the BT2020 color gamut, to obtain the first RGB image data.
9. The method of claim 6, wherein, The second color space conversion type indicated by the second color space conversion type information is used to perform color space conversion on the YUV image data, to obtain the first RGB image data. In a case where an implementation type of an application used for displaying the dynamic image is TextureView or GLSurfaceView, a graphic processor is invoked to perform color space conversion on the YUV image data according to the second color space conversion type, to obtain the first RGB image data.
10. The method of claim 6, wherein, The second color space conversion type indicated by the second color space conversion type information is used to perform color space conversion on the YUV image data, to obtain the first RGB image data. In a case where an implementation type of an application used for displaying the dynamic image is SurfaceView, a display processing unit is invoked to perform color space conversion on the YUV image data according to the second color space conversion type, to obtain the first RGB image data.
11. The method of claim 1, wherein, The method further includes: In a case where the second color space conversion type information fails to be written into the file header or the second color space conversion type information is not obtained by decoding the dynamic image file, YUV image data is color space converted according to BT709_YUV2RGB, to obtain RGB image data; wherein the YUV image data is YUV image data obtained by decoding the dynamic image file.
12. An image processing apparatus characterized by comprising: The apparatus includes: A writing module is configured to write first information into a file header of a dynamic image file; wherein the dynamic image file is a file obtained by encoding first RGB image data of a dynamic image in a RGB color space by using a first color space conversion type, the first information includes second color space conversion type information, and the second color space conversion type information is used to indicate a second color space conversion type.
13. The apparatus of claim 12, wherein, in a case where a color gamut corresponding to the first color space conversion type is smaller than a source color gamut of the dynamic image, the first information includes P3 color space parameter information and the second color space conversion type information; wherein the source color gamut of the dynamic image is a P3 color gamut.
14. The apparatus of claim 13, wherein, the first color space conversion type is BT601_RGB2YUV, and the second color space conversion type is BT601_YUV2RGB; or the first color space conversion type is BT709_RGB2YUV, and the second color space conversion type is BT709_YUV2RGB.
15. The apparatus of claim 12, wherein, In a case where a color gamut corresponding to the first color space conversion type is greater than a source color gamut of the dynamic image, the first information comprises the second color space conversion type information and P3 color gamut parameters; the second color space conversion type information is color space parameters corresponding to the second color space conversion type, and the source color gamut of the dynamic image is a P3 color gamut.
16. The apparatus of claim 15, wherein, the first color space conversion type is BT2020_RGB2YUV, and the second color space conversion type is BT2020_YUV2RGB.
17. The apparatus of any one of claims 12 to 16, wherein, The apparatus further comprises: a decoding module configured to decode the dynamic image file to obtain YUV image data of the dynamic image in a YUV color space and the second color space conversion type information; a first color space conversion module configured to perform color space conversion on the YUV image data according to the second color space conversion type indicated by the second color space conversion type information to obtain the first RGB image data; a display module configured to display the dynamic image according to the first RGB image data.
18. The apparatus of claim 17, wherein, The apparatus further comprises: a first color gamut conversion module configured to, in a case where a color gamut corresponding to the first color space conversion type is a BT2020 color gamut, convert the first RGB image data from the BT2020 color gamut to a P3 color gamut to obtain second RGB image data; the display module is specifically configured to: display the dynamic image according to the second RGB image data.
19. The apparatus of claim 18, wherein, The apparatus further comprises: a second color gamut conversion module configured to, before performing color space conversion on the first RGB image data by using the first color space conversion type, convert the second RGB image data from the P3 color gamut to the BT2020 color gamut to obtain the first RGB image data.
20. The apparatus of claim 18, wherein, the first color gamut conversion module is specifically configured to: in a case where an implementation type of an application used for displaying the dynamic image is TextureView or GLSurfaceView, invoke a graphic processor to perform color space conversion on the YUV image data according to the second color space conversion type to obtain the first RGB image data.
21. The apparatus of claim 18, wherein, the first color gamut conversion module is specifically configured to: in a case where an implementation type of an application used for displaying the dynamic image is SurfaceView, invoke a display processing unit to perform color space conversion on the YUV image data according to the second color space conversion type to obtain the first RGB image data.
22. The apparatus of claim 12, wherein, The apparatus further comprises: a second color space conversion module configured to, in a case where writing the second color space conversion type information into the file header fails or decoding the dynamic image file fails to obtain the second color space conversion type information, perform color space conversion on YUV image data according to BT709_YUV2RGB to obtain RGB image data; the YUV image data is YUV image data obtained by decoding the dynamic image file.
23. An electronic device, comprising: The electronic device comprises a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions being executed by the processor to implement the steps of the image processing method according to any one of claims 1-11.
24. A readable storage medium characterized by, The readable storage medium stores a program or instructions, the program or instructions being executed by the processor to implement the steps of the image processing method according to any one of claims 1-11.