Search

CN-113850882-B - Picture processing method and device, storage medium and electronic equipment

CN113850882BCN 113850882 BCN113850882 BCN 113850882BCN-113850882-B

Abstract

The disclosure belongs to the technical field of image processing, and relates to a picture processing method and device, a storage medium and electronic equipment. The method comprises the steps of obtaining a picture to be processed, carrying out hierarchical merging processing on the picture to be processed to obtain a color table, carrying out color table conversion on the color table to obtain a color level picture, carrying out index query processing on the color level picture to obtain an index table of the picture to be processed, and carrying out picture color reduction processing on the color level picture and the index table to obtain a target picture corresponding to the picture to be processed. In the picture processing process, the hierarchical merging processing and the index query processing can be operated in parallel, the picture processing efficiency is improved, and the requirement that a target picture can be obtained without any clamping in the running state of games or other applications is met. And the image color reduction processing is carried out on the two data of the color level image and the index table, so that the image color reduction processing effect is improved, and the use experience and the sensory experience of a user are optimized.

Inventors

  • ZHOU YUCHAO

Assignees

  • 网易(杭州)网络有限公司

Dates

Publication Date
20260505
Application Date
20210927

Claims (7)

  1. 1. A picture processing method, the method comprising: The method comprises the steps of obtaining a picture to be processed, carrying out rule recombination processing on the picture to be processed to obtain recombined picture data, and carrying out data analysis processing on the recombined picture data to obtain picture texture data, wherein the picture texture data comprises Morton code data, carrying out reverse ordering processing on the picture texture data to obtain picture dictionary data, and carrying out hierarchical merging processing on the picture dictionary data to obtain a color table, wherein a key in the picture dictionary data is the Morton code data, and a value is the hit number of the Morton code data; The Morton code data and the target layer number are utilized to carry out channel writing processing on the picture format to obtain a color level picture, and index inquiry processing is carried out on the color level picture to obtain an index table of the picture to be processed; And carrying out picture color reduction processing on the color level picture and the index table to obtain a target picture corresponding to the picture to be processed.
  2. 2. The picture processing method according to claim 1, wherein the performing hierarchical merging processing on the picture dictionary data to obtain a color table includes: If the picture texture data form a tree structure, carrying out hierarchical merging processing on the picture dictionary data according to the tree structure to obtain merging count; And comparing the count threshold corresponding to the combined count with the combined count to obtain a count comparison result, and determining a color table corresponding to the combined count according to the count comparison result.
  3. 3. The method for processing a picture according to claim 1, wherein performing the picture color reduction processing on the color level picture and the index table to obtain a target picture corresponding to the picture to be processed comprises: if the color-reducing picture corresponding to the picture to be processed is in a picture exchange format, carrying out picture color-reducing processing on the color-level picture and the index table to obtain a target picture corresponding to the picture to be processed; And if the color reduction picture corresponding to the picture to be processed is in a non-graphic exchange format, carrying out picture color reduction processing on the picture to be processed, the color level picture and the index table to obtain a target picture corresponding to the picture to be processed.
  4. 4. The picture processing method according to claim 1, wherein the performing index query processing on the color level picture to obtain the index table of the picture to be processed includes: acquiring a picture pixel value of the color level picture, and comparing the Morton code data with the picture pixel value to obtain a pixel comparison result; And obtaining an index table of the picture to be processed according to the pixel comparison result.
  5. 5. A picture processing apparatus, characterized by comprising: The system comprises a hierarchical merging module, a picture texture data processing module, a picture dictionary data processing module and a color table processing module, wherein the hierarchical merging module is configured to acquire a picture to be processed, conduct regular recombination processing on the picture to be processed to obtain recombined picture data, conduct data analysis processing on the recombined picture data to obtain picture texture data, and the picture texture data comprises Morton code data; The index inquiry module is configured to acquire a picture format corresponding to the color table and a target layer number of the recombined picture data, perform channel writing processing on the picture format by utilizing the Morton code data and the target layer number to obtain a color level picture, and perform index inquiry processing on the color level picture to obtain an index table of the picture to be processed; and the picture color reduction module is configured to perform picture color reduction processing on the color level picture and the index table to obtain a target picture corresponding to the picture to be processed.
  6. 6. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the picture processing method of any one of claims 1-4.
  7. 7. An electronic device, comprising: A processor; a memory for storing executable instructions of the processor; wherein the processor is configured to perform the picture processing method of any of claims 1-4 via execution of the executable instructions.

Description

Picture processing method and device, storage medium and electronic equipment Technical Field The present disclosure relates to the field of image processing technologies, and in particular, to a picture processing method and apparatus, a computer readable storage medium, and an electronic device. Background With the development of computers, the variety of picture formats is increasing. Among these, there are many compression formats such as GIF (GRAPHICS INTERCHANGE Format ) among the picture formats. Therefore, the need to color down the picture to make the picture conform to the compression format is also becoming a problem to be solved. Currently, this problem is solved using the conventional octree method or clustering method. The traditional octree color reduction is divided into three processes of tree building, tree combination and searching for indexes of corresponding colors. After each pixel value of the image is assigned to the last layer of nodes of the octree through the process, pruning operation is further carried out on the current octree according to the target color number so as to carry out the completed color reduction processing. The tree structure related to the color reduction processing process has the up-down dependence of the branch and leaf nodes, and the color reduction processing process and the clustering method are calculated on a CPU (central processing unit ) in series, so that the consumption of the CPU is too great. In addition, when the problem of color degradation is handled on a mobile terminal such as a mobile phone, the mobile phone is stuck and heated, and the color degradation result is obtained for a long time, which is a serious time-consuming situation. In view of this, there is a need in the art to develop a new image processing method and apparatus. It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art. Disclosure of Invention The disclosure aims to provide a picture processing method, a picture processing device, a computer readable storage medium and an electronic device, so as to overcome the technical problems of poor picture processing effect and stuck terminal equipment caused by the limitation of the related technology at least to a certain extent. Other features and advantages of the present disclosure will be apparent from the following detailed description, or may be learned in part by the practice of the disclosure. According to a first aspect of an embodiment of the present invention, there is provided a picture processing method, including: Obtaining a picture to be processed, and carrying out hierarchical merging processing on the picture to be processed to obtain a color table; performing color table conversion on the color table to obtain a color level picture, and performing index query processing on the color level picture to obtain an index table of the picture to be processed; And carrying out picture color reduction processing on the color level picture and the index table to obtain a target picture corresponding to the picture to be processed. In an exemplary embodiment of the present invention, the performing a hierarchical merging process on the to-be-processed picture to obtain a color table includes: Performing rule recombination processing on the picture to be processed to obtain recombined picture data, and performing data analysis processing on the recombined picture data to obtain picture texture data; and carrying out reverse ordering treatment on the picture texture data to obtain picture dictionary data, and carrying out hierarchical merging treatment on the picture dictionary data to obtain a color table. In an exemplary embodiment of the present invention, the performing a hierarchical merging process on the picture dictionary data to obtain a color table includes: If the picture texture data form a tree structure, carrying out hierarchical merging processing on the picture dictionary data according to the tree structure to obtain merging count; And comparing the count threshold corresponding to the combined count with the combined count to obtain a count comparison result, and determining a color table corresponding to the combined count according to the count comparison result. In an exemplary embodiment of the present invention, the performing a picture color reduction process on the color level picture and the index table to obtain a target picture corresponding to the picture to be processed includes: if the color-reducing picture corresponding to the picture to be processed is in a picture exchange format, carrying out picture color-reducing processing on the color-level picture and the index table to obtain a target picture corresponding to the picture to be processed; And if the color reduction pictur