Image display method and device, medium and product

Through European-style distance calculation and chromatic aberration diffusion technology, the color matching problems inaccurate and detail loss when converting high-deep images to low-deep images is solved, achieving more efficient image conversion effects and improving user experience.

CN119180872APending Publication Date: 2024-12-24GUANGZHOU BAOLUN ELECTRONICS CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411231378.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

When converting high-deep depth images to low-deep depth images, inaccurate color matching and loss of details are prone to occur, resulting in poor conversion effects and reducing user experience.

Method used

The European-style distance calculation method is used to obtain the color plate color of each pixel point in the image to be processed, and the color difference is diffused to adjacent pixel points to generate target pixel points to achieve accurate color restoration and reduce detail loss.

Benefits of technology

It improves color reproduction, improves image conversion effect and speed, improves user experience, and is suitable for low-level depth display devices such as electronic ink screens and multi-color printing devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119180872A_ABST
    Figure CN119180872A_ABST
Patent Text Reader

Abstract

The invention provides an image display method and device, a medium and a product, and relates to the technical field of image processing. The image display method comprises the steps of calculating a color plate color corresponding to a current color of each pixel point in a to-be-processed image based on an Euclidean distance; obtaining the color difference between the current color and the corresponding color of the color plate, and diffusing the color difference to adjacent pixel points of the pixel points to obtain target pixel points; and displaying an image based on the target pixel point. According to the embodiment of the invention, the color palette color matched with each pixel point in the to-be-processed image can be accurately obtained, the color rendition degree is improved, detail loss generated by image conversion can be reduced, the conversion effect is good, the conversion speed is high, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology. Specifically, the present application relates to an image display method, device, medium and product. Background Art

[0002] In the field of modern image processing, there are situations where low-bit depth display devices (such as electronic ink screens, multi-color printing devices, etc.) are used to display images produced or photographed by other devices. However, images produced or photographed by other devices are often high-bit depth images, which do not match the display requirements of low-bit depth display devices. They need to be converted into low-bit depth images first, and then displayed according to the converted images. However, the existing conversion method only sets the converted color corresponding to each color, and converts the image based on the corresponding relationship. When the image obtained by this conversion method is displayed, it is easy to have problems such as inaccurate color matching and loss of details, and the conversion effect is poor, which reduces the user experience. Summary of the invention

[0003] The embodiments of the present application provide an image display method, device, medium and product, which can solve the problems of inaccurate color matching and loss of details in the existing conversion method, poor conversion effect and reduced user experience. To achieve this purpose, the embodiments of the present application provide the following solutions.

[0004] According to one aspect of an embodiment of the present application, there is provided an image display method, comprising:

[0005] Calculate the color palette color corresponding to the current color of each pixel in the image to be processed based on the Euclidean distance;

[0006] Obtaining the color difference between the current color and the corresponding color palette color, and diffusing the color difference to adjacent pixels of the pixel to obtain a target pixel;

[0007] An image is displayed based on the target pixel point.

[0008] In a possible implementation, calculating the color of the palette corresponding to each pixel in the image to be processed based on the Euclidean distance includes:

[0009] Preprocessing the image to be processed to generate a new image;

[0010] The color value of the current color of each pixel in the new image is obtained, and the color of the palette corresponding to each pixel is calculated according to the color value and the Euclidean distance formula.

[0011] In a possible implementation, obtaining the color value of the current color of each pixel in the new image includes:

[0012] The height and width of the new image are obtained, pixels in the new image are traversed based on the height and width, and the color value of the current color of the pixel in a predetermined color mode is obtained.

[0013] In a possible implementation, calculating the color palette color corresponding to each pixel point according to the color value and the Euclidean distance formula includes:

[0014] Obtaining the color value of each color palette color, and calculating the overall color difference between the current color of the pixel and each color palette color using the Euclidean distance formula, the color value of the current color, and the color value of each color palette color;

[0015] The color palette color corresponding to each pixel is determined according to the overall color difference.

[0016] In a possible implementation, the preprocessing the image to be processed includes:

[0017] compressing the image to be processed according to the resolution of the target display object;

[0018] The compressed image to be processed is converted into a predetermined format, where the predetermined format corresponds to the predetermined color mode.

[0019] In a possible implementation manner, diffusing the color difference to adjacent pixels of the pixel includes:

[0020] The color difference is diffused to adjacent pixels of the pixel using a preset error diffusion method according to a predetermined pixel traversal order.

[0021] In a possible implementation, displaying an image based on the target pixel includes:

[0022] forming a target image based on the target pixel points;

[0023] Modulo is performed according to the number of colors of the target image, and the target image is displayed based on the modulo result.

[0024] According to one aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described above.

[0025] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described above are implemented.

[0026] According to one aspect of an embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method described above are implemented.

[0027] The beneficial effects of the technical solution provided by the embodiment of the present application are:

[0028] The image display method provided by the present application calculates the palette color corresponding to the current color of each pixel in the image to be processed based on the Euclidean distance; obtains the color difference between the pixel and the corresponding palette color, diffuses the overall color difference to the adjacent pixels of the pixel, and obtains the target pixel; and displays the image based on the color of the target pixel. The embodiment of the present application can accurately obtain the palette color that matches each pixel in the image to be processed, improve the color restoration, and reduce the detail loss caused by image conversion. The conversion effect is good and the conversion speed is fast, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following is a brief introduction to the drawings required for use in describing the embodiments of the present application.

[0030] Figure 1 A flowchart of an image display method provided in an embodiment of the present application;

[0031] Figure 2 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.

[0033] It will be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation of other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the present technical field. It should be understood that when we say that an element is "connected" or "coupled" to another element, the one element may be directly connected or coupled to the other element, or it may refer to that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term, for example, "A and / or B" indicates that it is implemented as "A", or is implemented as "A", or is implemented as "A and B".

[0034] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0035] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on or combine with each other, and the same terms, similar features and similar implementation steps in different embodiments will not be described repeatedly.

[0036] The image display method, device, medium and product provided in this application are intended to solve at least one technical problem existing in the prior art.

[0037] An image display method is provided in an embodiment of the present application. The method can be used for low-bit display devices such as ink screen devices and multi-color printing devices that require image conversion, and can also be a device connected to the low-bit display device and used for image conversion.

[0038] Alternatively, if Figure 1 As shown, the image display method includes:

[0039] S101: Calculate the color of the palette corresponding to the current color of each pixel in the image to be processed based on the Euclidean distance.

[0040] Optionally, calculating the palette color corresponding to each pixel in the image to be processed based on the Euclidean distance includes: preprocessing the image to be processed to generate a new image; obtaining the color value of the current color of each pixel in the new image, and calculating the palette color corresponding to each pixel according to the color value and the Euclidean distance formula. The palette color that best matches the current color of the pixel is determined as the palette color corresponding to the pixel.

[0041] In one embodiment, both the new image and the image to be processed may be dot matrix images, and the pixels in the image are displayed in the form of an array to facilitate subsequent processing.

[0042] Optionally, before preprocessing the image to be processed, it is also possible to detect whether the object used for image display can display the image to be processed. If it is determined that it can be displayed, the image display method of the present application is not executed, and the object is controlled to display the image to be processed. It is also possible to detect whether the color palette class includes all the colors in the image to be processed. If so, it is determined that no image conversion is required and the image display method is not executed. If not, it is determined that the image display method needs to be executed.

[0043] Optionally, preprocessing the image to be processed includes: compressing the image to be processed according to the resolution of the target display object; converting the compressed image to be processed into a predetermined format, where the predetermined format corresponds to a predetermined color mode.

[0044] Optionally, when compressing an image, data of the image to be processed and the height and width of the compressed image to be processed are acquired, and image compression processing is performed based on the acquired data.

[0045] In one embodiment, the target display object may be an ink screen, and the resolution of the ink screen may be determined as the resolution of the image to be processed after compression. Specifically, when the operating system of the ink screen is an Android system, the image compression function of the Android system may be used to compress the image to obtain an image that matches the ink screen, thereby reducing the amount of data for subsequent processing. When the image compression function is called to perform image compression, preset parameters are obtained, and a compressed image is obtained based on the preset parameters. The preset parameters include the data of the image to be processed, the height and width of the compressed image, and whether bilinear filtering is used during compression.

[0046] Optionally, the predetermined format can be ARGB_8888 format, which is a configuration mode of Bitmap in the Android system, used to specify the pixel format of the bitmap. Specifically, it defines how each pixel is stored and its memory usage. When the predetermined color mode is RGB mode, each color channel in the ARGB_8888 format has 8 bits, which can represent 256 levels of grayscale, so that 16,777,216 colors (256x256x256) can be presented. This can facilitate the separation of color values ​​corresponding to the three color channels of R, G, and B for subsequent processing.

[0047] Optionally, obtaining the color value of the current color of each pixel in the new image includes: obtaining the height and width of the new image, traversing the pixels in the new image based on the height and width, and obtaining the color value of the current color of the pixel in a predetermined color mode.

[0048] Optionally, after preprocessing the image to be processed and obtaining the new image, the number of pixels in height and width of the new image is obtained according to the pixel array in the new image, and the height and width of the new image are determined based on the number of pixels.

[0049] In one embodiment, the height and width of the new image can be determined by the following formula:

[0050] val width = bitmap.width

[0051] val height = bitmap.height

[0052] Among them, val width represents the number of pixels included in the width side of the new image, bitmap.width represents the width of the new image, val height represents the number of pixels included in the height side of the new image, and bitmap.height represents the height of the new image.

[0053] Optionally, the predetermined color mode may be an RGB mode, and a preset splitting tool may be called to obtain the color value of each pixel in different color channels.

[0054] In one embodiment, the pixels in the new image are traversed based on the acquired height and width, and during the traversal, the color data of each pixel is decomposed into 0-255 values ​​of three colors, R, G, and B, through the android.graphics.Color class, and saved into a two-dimensional array named rGBTripleArr. The relevant program may include:

[0055] for(x in 0 until width){

[0056] for(y in 0until height){

[0057] val pixel=bitmap.getPixel(x,y)

[0058] rGBTripleArr[x][y]=RGBTriple(

[0059] byteArrayOf(

[0060] Color.red(pixel).toByte(),

[0061] Color.green(pixel).toByte(),

[0062] Color.blue(pixel).toByte() ) )

[0065] }

[0066] }

[0067] Optionally, the palette color corresponding to each pixel is calculated according to the color value and the Euclidean distance formula, including: obtaining the color value of each palette color, calculating the overall color difference between the current color of the pixel and each palette color using the Euclidean distance formula, the color value of the current color, and the color value of each palette color; and determining the palette color corresponding to each pixel according to the overall color difference.

[0068] Optionally, the color value of each palette color can be marked by the palette class PaletteUtils. After obtaining the color value corresponding to each pixel, the type and quantity of the palette colors to be matched are determined based on the palette class PaletteUtils.

[0069] Optionally, the number of palette colors can be 2, 3, 4, 7, or other numbers. When obtaining the palette color corresponding to a pixel, the pixels are taken out one by one according to a predetermined order, and the color difference between the current color of the pixel and each palette color is calculated according to the color value corresponding to the pixel. The palette color with the smallest overall color difference is determined as the palette color corresponding to the pixel.

[0070] Optionally, the color of the palette and the current color of the pixel point use the same color mode. If the color modes of the two are different, they need to be converted to the same color mode before calculating the overall color difference.

[0071] In one embodiment, the Euclidean distance is used to calculate the overall color difference between the current color and the color of the palette. The relevant formula can be:

[0072] ΔE 2 =(R current -R palette ) 2 +(G current -G palette ) 2 +(B current -B palette ) 2

[0073] Where, ΔE 2 is the overall color difference, R currentIndicates the color value of the current color on the red channel, R palette Indicates the color value of the palette color on the red channel, G current Indicates the color value of the current color on the green channel, G palette Indicates the color value of the color palette on the green channel, B current Indicates the color value of the current color on the blue channel, B palette Indicates the color value of the palette color on the blue channel. Gets the overall color difference between the current color of the pixel and each palette color, and determines the palette color with the smallest overall color difference as the palette color that matches the current color.

[0074] Optionally, the order of traversing the pixels may be from left to right and then from top to bottom. The traversal may be performed according to the arrangement positions of the pixels in the new image, or according to the positions of the data corresponding to the pixels in the array storing the color values ​​of the pixels.

[0075] In one embodiment, the color values ​​are stored in a two-dimensional array named rGBTripleArr, and the two-dimensional array is traversed according to a predetermined traversal order to obtain the color value corresponding to each pixel.

[0076] S102: Obtain the color difference between the current color and the corresponding color palette color, diffuse the overall color difference to adjacent pixels of the pixel, and obtain a target pixel.

[0077] Optionally, the color difference between the current color and the corresponding palette color includes the color difference between the current color and the corresponding palette color in each color channel.

[0078] In one embodiment, the color difference between the current color and the corresponding color palette color is calculated using the following formula:

[0079] ΔR=R current -R palette

[0080] ΔG=G current -G palette

[0081] ΔB=B current -B palette

[0082] ΔR, ΔG, and ΔB represent the color difference of red, green, and blue respectively. A color is composed of RGB. The RGB values ​​of the color are split into 3 values ​​between 0 and 255. The values ​​represent the color values ​​of red, green, and blue. Based on the color values, the color difference between the current color and the color of the palette is obtained.

[0083] Optionally, diffusing the color difference to the adjacent pixel points of the pixel point includes: diffusing the overall color difference to the adjacent pixel points of the pixel point using a preset error diffusion method according to a predetermined pixel point traversal order. The adjacent pixel point may be an object that is adjacent to the pixel point in four directions of up, down, left, and right without any other pixel points between the two.

[0084] Optionally, the preset error diffusion method includes using an error diffusion algorithm for error diffusion. The error diffusion algorithm includes any one of the Floyd-Steinberg algorithm, the Jarvis, Judice and Ninke algorithms, and the Stucki algorithm. In this way, the error between the current color of each pixel and the color of the color palette is diffused to adjacent pixels.

[0085] In one embodiment, the error diffusion algorithm may be a Floyd-Steinberg algorithm, which is used to perform error diffusion on pixels one by one. When the error is diffused, the error is diffused according to the color difference of each pixel in different color channels.

[0086] Optionally, the pixel traversal order may be from left to right, from top to bottom, or any other order that can traverse all the pixels. Furthermore, when performing error diffusion, if the pixel for error diffusion is assigned an error diffused by other pixels, the current color of the pixel is the color after the error is added.

[0087] Optionally, the error diffusion is performed row by row and pixel by pixel, and the error of a previous pixel will affect the error diffusion result of a next pixel.

[0088] In one embodiment, when the error diffusion algorithm is the Floyd-Steinberg algorithm, the diffusion coefficients are 7 / 16, 3 / 16, 5 / 16 and 1 / 16. The formula for diffusing the color difference ΔC of the pixel point (x, y) to the adjacent pixel points (x+1, y), (x-1, y+1), (x, y+1) and (x+1, y+1) is as follows:

[0089]

[0090] Among them, C′ x,y+1 Represents the color value of the pixel (x, y+1) on a color channel after error diffusion, C x,y+1 Indicates the color value of the pixel (x, y+1) on the color channel before error diffusion. At this time, ΔC represents the color difference of the pixel (x, y) on the color channel. C′ x+1,y Represents the color value of the pixel (x+1, y) on a color channel after error diffusion, C x+1,yIndicates the color value of the pixel (x+1, y) on the color channel before error diffusion. At this time, ΔC represents the color difference of the pixel (x, y) on the color channel. C′ x-1,y+1 Represents the color value of the pixel (x-1, y+1) on a color channel after error diffusion, C x-1,y+1 Indicates the color value of the pixel (x-1, y+1) on the color channel before error diffusion. At this time, ΔC represents the color difference of the pixel (x, y) on the color channel. C′ x+1,y+1 Represents the color value of the pixel (x+1, y+1) on a color channel after error diffusion, C x+1,y+1 It represents the color value of the pixel (x+1, y+1) on the color channel before error diffusion. At this time, ΔC represents the color difference of the pixel (x, y) on the color channel.

[0091] Each color channel of adjacent pixels is calculated using the above formula (eg, the error diffusion result of adjacent pixels on the red channel is calculated based on the color difference of the pixels on the red channel).

[0092] Optionally, during error diffusion, in order to ensure that the color value of the color channel corresponding to each pixel does not exceed the legal range (such as 0-255 corresponding to the RGB color mode), a truncation formula is also required to process the color value obtained after error diffusion. The truncation formula can be:

[0093] C′=max(0,min(255,C+ΔC))

[0094] Wherein, C' represents the color value processed by the truncation formula, and this color value is determined as the final color value of the pixel. Based on the above error diffusion result, the final color value corresponding to each pixel is obtained, and the pixel point with the final color value is determined as the target pixel point.

[0095] S103: Displaying an image based on the color of the target pixel.

[0096] Optionally, displaying an image based on the color of a target pixel includes: forming a target image based on the target pixel; taking a modulus according to the number of colors of the target image, and displaying the target image based on a result of the modulo taking.

[0097] Optionally, the color of the palette corresponding to the pixel is determined as the color of the target pixel, and an image preview display can be performed according to the color value of the target pixel. If it is confirmed that the next step can be executed according to the feedback information corresponding to the preview display, the image is displayed based on the target pixel. If it is confirmed that the next step cannot be executed, the color value of the target pixel or the palette color is adjusted according to the feedback information or the instruction input by the user.

[0098] Optionally, displaying an image based on a target pixel includes: forming a target image based on the target pixel; taking a modulus according to the number of colors of the target image, and displaying the target image based on a result of the modulo taking.

[0099] Optionally, when taking the module each time, the same color in the target image is extracted, and, in order to reduce the number of times of taking the module, only colors other than white can be extracted. When extracting a color, the position of the color in the target image can also be recorded.

[0100] Optionally, the number of modulos can be determined according to the number of palette colors. If the palette colors include white, the number of modulos is the number of palette colors minus one. If the palette colors do not include white, the number of modulos is equal to the number of palette colors.

[0101] In one embodiment, after acquiring the target image, the modulus is taken according to the number of colors possessed by the target image. Each time the modulus is taken, the same color in the target image is extracted to obtain the color value dot matrix corresponding to the color. Specifically, when the target image has 7 colors (white, black, red, yellow, green, blue, orange-red), 6 modulus can be taken (modulus for other colors except white). Each pixel occupies 1 bit, so the data size of the color modulus is: Wide*Height / 8.

[0102] Optionally, when the object displaying the target image is an ink screen, the color data obtained by taking the model can be displayed on the ink screen by refreshing.

[0103] In one embodiment, the display object is an ink screen. During the refresh process of the ink screen, if a 4-color ink screen (white, black, red, and yellow) is used, the refresh step includes: first, the entire screen is refreshed to white. Next, a "black model" representing the positions of all black dots is applied to the ink screen. Then, a "red model" representing the positions of all red dots is applied to the ink screen, and finally, a "yellow model" representing the positions of all red dots is applied to the ink screen, wherein the black model, red model, and yellow model refer to the color value dot matrices corresponding to black, red, and yellow, respectively, and the positions of different colors and the color values ​​corresponding to each position are determined based on the dot matrix.

[0104] The beneficial effects of this application include:

[0105] 1. Use the square of the Euclidean distance between color channels to calculate color differences and improve the accuracy of color matching.

[0106] 2. Diffusion of errors to adjacent pixels. This method can more accurately match colors and effectively diffuse color errors in the dithering process of color images, thereby significantly improving the visual quality of low-bit depth color display. This application can retain more color details when processing multi-color images, improve image display effects when the difference between light and dark is small, and is widely applicable to various devices with a limited number of displayable colors.

[0107] 3. This application can perform parallel computing on multi-core processors to further improve the efficiency of image processing and is suitable for real-time image processing applications.

[0108] In an optional embodiment, an electronic device is provided, such as Figure 2 As shown, Figure 2 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.

[0109] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0110] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0111] Memory 4003 can be ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or it can be EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disc, optical disk, digital versatile disc, Blu-ray disc, etc.), magnetic disk storage medium, other magnetic storage devices or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation here.

[0112] The memory 4003 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the computer program stored in the memory 4003 to implement the steps shown in the above method embodiment.

[0113] Among them, the electronic device can be any electronic product that can interact with an object, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television (IPTV), a smart wearable device, etc.

[0114] The electronic device may also include a network device and / or an object device, wherein the network device includes, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud consisting of a large number of hosts or network servers for cloud computing.

[0115] The network where the electronic device is located includes but is not limited to the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (Virtual Private Network, VPN), etc.

[0116] An embodiment of the present application provides a computer-readable storage medium, which includes a computer program. When the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.

[0117] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.

[0118] The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that shown or described in the drawings.

[0119] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart are used for actual implementation scenarios, and may include multiple sub-steps or multiple stages. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage in these sub-steps or stages can also be executed at different times respectively. In different scenarios at the execution time, the execution order of these sub-steps or stages can be flexibly configured according to demand, and the embodiment of the present application does not limit this.

[0120] The above is only an optional implementation method for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of the present application, other similar implementation means used for the technical ideas of the present application also fall within the protection scope of the embodiments of the present application.

Claims

1. An image display method, characterized in that: include: Calculate the color palette color corresponding to the current color of each pixel in the image to be processed based on the Euclidean distance; Obtaining the color difference between the current color and the corresponding color palette color, and diffusing the color difference to adjacent pixels of the pixel to obtain a target pixel; An image is displayed based on the target pixel point.

2. The image display method according to claim 1, characterized in that: The method of calculating the color palette color corresponding to each pixel in the image to be processed based on the Euclidean distance includes: Preprocessing the image to be processed to generate a new image; The color value of the current color of each pixel in the new image is obtained, and the color of the palette corresponding to each pixel is calculated according to the color value and the Euclidean distance formula.

3. The image display method according to claim 2, characterized in that: The step of obtaining the color value of the current color of each pixel in the new image includes: The height and width of the new image are obtained, pixels in the new image are traversed based on the height and width, and the color value of the current color of the pixel in a predetermined color mode is obtained.

4. The image display method according to claim 2, characterized in that: The calculating the color palette color corresponding to each pixel point according to the color value and the Euclidean distance formula includes: Obtaining the color value of each color palette color, and calculating the overall color difference between the current color of the pixel and each color palette color using the Euclidean distance formula, the color value of the current color, and the color value of each color palette color; The color palette color corresponding to each pixel is determined according to the overall color difference.

5. The image display method according to claim 3, characterized in that: The preprocessing of the image to be processed comprises: compressing the image to be processed according to the resolution of the target display object; The compressed image to be processed is converted into a predetermined format, where the predetermined format corresponds to the predetermined color mode.

6. The image display method according to claim 1, characterized in that: The step of diffusing the color difference to adjacent pixels of the pixel includes: The color difference is diffused to adjacent pixels of the pixel using a preset error diffusion method according to a predetermined pixel traversal order.

7. The image display method according to claim 1, characterized in that: The displaying of an image based on the target pixel point comprises: forming a target image based on the target pixel points; Modulo is performed according to the number of colors of the target image, and the target image is displayed based on the modulo result.

8. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method for processing color images based on improved Floyd-Steinberg algorithm

    CN102496149A

  • JPEG (Joint Photographic Experts Group) image processing method and system

    CN102547058A

  • Picture display method and device, electronic equipment and storage medium

    CN113314079A