Image processing method and device, electronic equipment and storage medium

By performing first halftone processing during color image editing and second halftone processing during scaling, the problem of inconsistent display effects of color images on high-color-level and e-paper displays is solved, improving the user editing experience.

CN116171457BActive Publication Date: 2026-01-13BOE TECHNOLOGY GROUP CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202180002676.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-24
Publication Date
2026-01-13
Estimated Expiration
2041-09-24

AI Technical Summary

Technical Problem

Existing technologies, after converting color images into multi-color images, result in inconsistent display effects on high-color-scale displays and e-paper displays, leading to a poor user editing experience.

Method used

The color image undergoes a first halftone processing, and a second halftone processing is performed when the user zooms in, ensuring consistent image display on both high-color-scale displays and e-paper displays.

Benefits of technology

By adjusting the halftone processing of images in real time, the consistency of the display effect on the e-paper display is improved, and the convenience of image editing and user experience are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116171457B_ABST
    Figure CN116171457B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image processing method, which relates to the field of display, and particularly relates to the field of color image display. The specific implementation scheme is as follows: obtaining an original image; performing first halftone processing on the original image to obtain a first image; and in response to detecting a zoom operation on the first image, performing second halftone processing on the original image after adjusting the size of the original image to obtain a second image. The present disclosure also provides an image processing device, an electronic device and a computer readable storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of displays, and more particularly to color image display technology and electronic paper technology. More specifically, this disclosure provides an image processing method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the development of electronic technology, electronic paper display technology is being used more and more widely in daily life and work. For electronic paper displays that support multiple colors (such as black and white, and at least one color other than black and white), in order to retain the color information in the color image to the greatest extent and to give full play to the display capabilities of the multi-color electronic paper display, the color image can be converted into a multi-color image.

[0003] In related technologies, after a color image is converted into a multi-color image, if the multi-color image is scaled or otherwise manipulated, the display effect of the multi-color image on a display screen with high color gradation will be different from the display effect on an electronic paper display screen. Summary of the Invention

[0004] This disclosure provides an image processing method, apparatus, electronic device, and storage medium.

[0005] According to a first aspect, an image processing method is provided, comprising: acquiring an original image; performing a first halftone processing on the original image to obtain a first image; and, in response to detecting a scaling operation on the first image, adjusting the size of the original image and performing a second halftone processing to obtain a second image.

[0006] According to a second aspect, an image processing apparatus is provided, the apparatus comprising: an original image acquisition module for acquiring an original image; a first halftone processing module for performing first halftone processing on the original image to obtain a first image; and a second halftone processing module for adjusting the size of the original image and performing second halftone processing in response to detecting a scaling operation on the first image to obtain a second image.

[0007] According to a third aspect, an electronic device is provided, comprising: at least one processor; and a memory coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a method provided according to the present disclosure.

[0008] According to a fourth aspect, a non-transitory computer-readable storage medium is provided that stores computer instructions for causing a computer to perform the methods provided in this disclosure.

[0009] According to a fifth aspect, a computer program product is provided, including a computer program that, when executed by a processor, implements the method provided in this disclosure.

[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0011] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0012] Figure 1 This is an exemplary architectural diagram of an image processing method and apparatus applicable according to an embodiment of the present disclosure;

[0013] Figure 2 This is a schematic diagram illustrating the display effect of an image without image processing.

[0014] Figure 3 This is a schematic diagram illustrating the image processing and electronic paper display effects in related technologies;

[0015] Figure 4 This is a flowchart of an image processing method according to an embodiment of the present disclosure;

[0016] Figure 5 This is a schematic diagram of image scaling according to an embodiment of the present disclosure;

[0017] Figure 6 This is a schematic diagram of a filter according to an embodiment of the present disclosure;

[0018] Figure 7 This is a schematic diagram of an error propagation process according to an embodiment of the present disclosure;

[0019] Figure 8 This is a schematic diagram illustrating the display effect after image processing according to an embodiment of the present disclosure;

[0020] Figure 9 This is a schematic diagram illustrating the effect of image selection and cropping according to an embodiment of the present disclosure;

[0021] Figure 10 This is a schematic diagram illustrating image resizing according to an embodiment of the present disclosure;

[0022] Figure 11 This is a schematic diagram of displaying an image in an image editing template according to an embodiment of the present disclosure;

[0023] Figure 12This is a schematic diagram of editing an image in an image editing template according to an embodiment of the present disclosure;

[0024] Figure 13 This is a schematic diagram illustrating the addition of text to an image editing template according to an embodiment of the present disclosure;

[0025] Figure 14 This is a flowchart of a method for image processing according to an embodiment of the present disclosure;

[0026] Figure 15 This is a block diagram of an image processing apparatus according to an embodiment of the present disclosure; and

[0027] Figure 16 This is a block diagram of an electronic device for performing an image processing method according to an embodiment of the present disclosure. Detailed Implementation

[0028] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0029] To facilitate understanding of the technical solutions disclosed herein, some of the terms involved will be explained first.

[0030] Electronic paper (E-paper) uses electrophoretic display technology and only consumes power when refreshing the image. After refreshing is complete and power is turned off, the image can still be displayed normally. Common electronic paper can only display a limited number of colors, such as black and white, black and white with red, or black and white with yellow.

[0031] Halftone processing: One of the essential technologies for electronic paper image display, it refers to quantizing a continuous-tone image (such as a grayscale image and a color image) into a binary image or a color image with only a few colors using a small number of colors. The quantized image has a similar visual effect to the original image at a certain distance.

[0032] With the development of electronic technology, electronic paper display technology has achieved rapid development and increasingly widespread application in the past few years. For example, electronic paper displays are widely used in products such as e-book readers, electronic paper products, shelf labels, and electronic nameplates.

[0033] Electrophoretic displays (EPDs) have become a popular R&D technology for electronic paper displays due to their superior characteristics. For example, compared to transmissive displays, electrophoretic displays are reflective displays, which are more comfortable to read. Furthermore, electrophoretic displays are bistable, meaning they can maintain image display even without power, consuming power only when the user refreshes the image. Electrophoretic displays can be mainly divided into wet-type electrophoretic displays and dry-type quick-response liquid powder displays (QR-LPDs). Wet-type electrophoretic displays can be implemented using microcapsule or microcup technology. However, because the display method of electronic paper displays differs from that of traditional LCD screens, the color gamut of electrophoretic displays is much smaller than that of the standard RGB (sRGB) color space.

[0034] For example, most e-paper displays can only display a limited number of two or three colors, such as black and white, black, white and red, black, white and yellow, etc.

[0035] For two-color e-paper displays, color images need to be converted to black and white. For example, a color image can be binarized based on a threshold to convert it into a binary black and white image for display on the e-paper display.

[0036] For a three-color e-paper display, all three colors can be displayed. The image processor of the e-paper display can convert a color image into a halftone image according to a certain algorithm. For example, if it is necessary to achieve a similar color visual effect on an e-paper display to an ordinary color image, the color image can first be halftone processed to quantize it into a dot map containing only three colors. The grayscale of the image is expressed by the density of the dots. Due to the low-pass vision characteristics of the human eye, the processed image has a visual effect similar to the original image at a certain distance between the human eye and the e-paper display.

[0037] When users edit images on a high color gamut display (such as an LCD screen, OLED screen, plasma screen, or cathode ray tube screen), they may want to display the color image being edited on the high color gamut display with the display effect of an e-paper screen, so that users can see how the edited color image is displayed on the e-paper screen.

[0038] However, some electronic paper image editing software in related technologies, for example, does not perform halftone processing on images and can only display solid color images without grayscale gradients. For instance, electronic paper image editing software cannot perform real-time halftone processing on background or inserted images, misleading users into believing that equally colorful images can be displayed on electronic paper. For example, while electronic paper image editing software may perform halftone processing on the original image upon insertion, when editing the image, such as scaling, it only scales the processed image. This results in the displayed effect being different from the effect of a halftone-processed image of the corresponding size (scaled).

[0039] Specifically, after halftone processing of a color image, if a user scales the processed image, the applicant found that the changed pixel density causes the image displayed on a high-color-scale display to appear different from the halftone-processed color image of the same size (after scaling). This results in a difference between the halftone-processed image's appearance on an e-paper display and its appearance on a high-color-scale display after scaling.

[0040] The technical solution disclosed herein can be applied to image editing programs to perform halftone processing on images (such as background images or inserted images), and to perform halftone processing again when the user zooms in on the image, ensuring that the image seen by the user is consistent with the image finally refreshed and displayed on the electronic paper.

[0041] The acquisition, storage, and application of image information involved in the technical solution disclosed herein all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0042] Figure 1 This is an exemplary architectural diagram illustrating an image processing method and apparatus applicable according to an embodiment of this disclosure. It should be noted that... Figure 1 The examples shown are merely exemplary architectures that can be applied to the embodiments of this disclosure to help those skilled in the art understand the technical content of this disclosure, but do not mean that the embodiments of this disclosure cannot be used in other devices, systems, environments or scenarios.

[0043] like Figure 1As shown, a user can edit a color image using the first electronic device 110. To facilitate viewing the editing effect, the edited color image can be displayed on the first display screen 120. For example, the user uses an image editing program to access the color image to be edited, and the image is displayed on a liquid crystal display screen coupled to the first electronic device 110. The liquid crystal display screen has a wide range of color levels and can display the true colors of the color image. The color image to be edited can be an image that needs to be displayed on a second display screen 140 (such as an electronic paper display screen, which has fewer color levels; the following explanation uses an electronic paper display screen as an example). To ensure that the visual effect of the image displayed on the electronic paper display screen meets the user's expectations, the user can use an image editing program to perform halftone processing on the color image to be edited, obtaining a halftone image, and then display the halftone image on the first display screen 120.

[0044] By employing the image processing methods described above, the display effect of halftone images on the LCD screen and the display effect of color images on the e-paper screen can be kept consistent. This allows users to edit color images using the first display screen 120 while maintaining the display effect of the e-paper screen. This effectively reduces the probability of users being dissatisfied with the display effect of the edited color image on the e-paper screen.

[0045] Figure 1 In this configuration, the second display screen 140 can be coupled to the first electronic device 110 so that the first electronic device 110 can control the second display screen 140 to display the edited image. Furthermore, the first electronic device 110 can send the edited image to a second electronic device 130 coupled to the second display screen 140 so that the second electronic device 130 can control the second display screen 140 to display the edited image.

[0046] It is understood that the first electronic device 110 and the second electronic device 130 are merely exemplary examples, and can be applied to many more electronic devices. The first display screen 120 and the second display screen 140 are merely exemplary examples, and can be applied to many more display screens.

[0047] Figure 2 This is a schematic diagram illustrating the display effect of an image without image processing. Figure 3 This is a schematic diagram illustrating the image processing and electronic paper display effects in related technologies.

[0048] like Figure 2 The image shown is a color image without halftone processing (converted to grayscale). The image has rich colors and high clarity. Figure 3Figure (a) is a halftone image after being processed by an image editing program using relevant technology. Although the image is distorted and the sharpness is reduced, the display effect is still good. Figure 3 Figure (b) is a color image displayed on an electronic paper screen. It can be seen that... Figure 3 The display effect of (a) figure and Figure 3 The display effects of (b) are quite different, which means that when users edit images on a high-color-level display screen, they cannot see the display effect of the edited image on the e-paper display screen.

[0049] Figure 4 This is a flowchart of an image processing method according to an embodiment of the present disclosure.

[0050] like Figure 4 As shown, the image processing method 400 may include operations S410 to S430.

[0051] The S410 is used to acquire the raw image.

[0052] The original image can be an image with multiple colors, which can realistically display the color information of the subject being photographed. The original image can be an image downloaded from the Internet, an image captured in real time, or an image stored locally, etc.

[0053] In some embodiments, acquiring the original image may include the following operations.

[0054] First, in response to a template retrieval operation for the image editing program, an image editing template is determined. This template can have a specified size, such as 100 pixels × 100 pixels. The template retrieval operation can be a click, swipe, or other action on a preset functional component. For example, after opening the e-paper image editing program, the user moves the mouse to the "Open Image" function in the function bar and clicks the left mouse button to retrieve an image from local storage or download it from the cloud.

[0055] Then, in response to an image acquisition operation by the image editing program, the original image is read by the image editing program or the shooting component is invoked to capture the original image. The functions of reading images and invoking the shooting component for capturing images can be found in relevant technologies and will not be detailed here.

[0056] Next, the original image is displayed in the image editing template.

[0057] In one specific embodiment, the original image can be acquired in the following three ways: For example, opening an image selection window and retrieving the image from a local folder; opening a camera window and using the camera to take a picture; or entering the Uniform Resource Locator (URL) address of a webpage image and downloading the image from the Internet.

[0058] In operation S420, the original image is subjected to first halftone processing to obtain the first image.

[0059] In this embodiment, a halftone image can be obtained by performing a first halftone processing on the original image. The color range of the original image can be greater than or equal to the color range of the first image. This halftone image can be a three-color image, such as black, white, and red, or black, white, and yellow, etc.

[0060] In operation S430, in response to detecting a scaling operation on the first image, the size of the original image is adjusted and then subjected to second halftone processing to obtain the second image.

[0061] In this design, the pixel density (Pixels Per Inch, PPI) of the first image is consistent with that of the second image. When scaling the first image, it is scaled proportionally to the original image, and a second halftone processing (using the same algorithm as the first halftone processing) is applied to the scaled original image to ensure that the displayed effect of the second image is consistent with that of the first image. PPI represents the number of pixels per inch. For example, the PPI of the first image and the PPI of the second image can be the same or similar. For example, the ratio between the PPI of the first image and the PPI of the second image can be less than or equal to a preset threshold. This preset threshold includes, but is not limited to, 0.1%, 0.5%, 1%, 1.5%, 2%, 3%, 5%, 8%, 10%, or 15%.

[0062] In some embodiments, responding to the detection of a scaling operation on the first image, adjusting the size of the original image and then performing second halftone processing to obtain a second image may include the following operations: For example, in response to the detection of a scaling operation on the first image, if a preset refresh condition is detected during the adjustment of the size of the original image, second halftone processing is performed on the scaled original image to obtain a second image.

[0063] The preset refresh condition can be a pre-defined condition that triggers the second halftone processing. When the preset refresh condition is met, it indicates that the image needs to undergo halftone processing to ensure that the pixel density of the image remains consistent.

[0064] Specifically, the preset refresh conditions may include at least one of the following: receiving a scaling operation, reaching a preset refresh cycle, or the scaling operation ending. The preset refresh cycle can be system-defined or user-defined.

[0065] For example, second halftone processing can be performed only after the user has completed the zooming operation. For instance, the user moves the mouse to the lower right corner of the image to be zoomed, clicks the left mouse button to perform a zooming operation, and after the user releases the left mouse button, it is determined that the user has completed the zooming operation. At this point, second halftone processing is performed on the zoomed original image.

[0066] For example, second halftone processing can be performed during a user's zooming operation. For instance, the user moves the mouse to the lower right corner of the image to be zoomed and clicks the left mouse button to perform a zoom operation. During this mouse zoom, second halftone processing is applied to the zoomed original image. This can be done when a change in mouse position is detected, or when the left mouse button is pressed for more than a preset duration threshold. The preset duration threshold can be system-defined or user-defined.

[0067] It should be noted that during image editing, the image to be edited can be displayed on a high-color-scale display screen. The second image can be displayed in high fidelity on an e-paper display screen.

[0068] In some embodiments, the first halftone processing and / or the second halftone processing described above can be performed using an electronic device coupled to a high color gamut display. The electronic device may have an image processing unit, which may be standalone or added as an additional peripheral component to the electronic device or computer system. The image processing unit may also be integrated into the electronic device or computer system.

[0069] In some embodiments, where the image processing apparatus is part of an electronic device, the code segment corresponding to the image processing apparatus, as software, can be stored in memory, and the aforementioned functions can be implemented by the processor executing the code segment. Alternatively, the image processing apparatus includes one or more of the aforementioned programs. Or, the aforementioned one or more programs include the image processing apparatus.

[0070] The electronic paper display can be an electrophoretic display screen, which can be applied to electronic devices such as e-book readers, electronic paper labels, and electronic nameplates. For example, the electronic paper display screen of this disclosure can be applied to e-book readers, thereby enabling the e-book reader to display images in multiple colors and improving the user experience.

[0071] In some implementations, the electronic paper display screen may have a processor, which may be a discrete component assembled in a certain way to have image processing capabilities, or a chip having the aforementioned capabilities in the form of an integrated circuit, or a computer program code segment that enables the electronic paper display screen to display a second image when running on the processor.

[0072] In some embodiments, image scaling can be achieved in the following manner.

[0073] Specifically, in response to detecting a scaling operation on the first image, performing second halftone processing on the original image after resizing it may include the following operations.

[0074] First, determine the first coordinate values ​​of the four vertices of the first image. These coordinate values ​​can be based on a point in the aforementioned image editing template. For example, the reference point could be any one of the four vertices of a rectangular image editing template. Alternatively, the reference point could be the center point of a quadrilateral image editing template. Or, the reference point could be a point on the monitor, such as any one of the four vertices of the monitor, or the center point of the monitor.

[0075] Then, in response to a zoom operation on the first image, a second coordinate value of the trigger point for the zoom operation is determined. The trigger point can be the location where the mouse triggers the zoom operation. The trigger point can be the location where a finger triggers the zoom operation on the touchscreen. The trigger point can be the location where the user's eyes are focused when the user triggers the zoom operation (e.g., by blinking rapidly three times in succession).

[0076] Next, determine the difference between the first coordinate value of the top left vertex and the second coordinate value of the trigger point.

[0077] Then, the size of the original image is adjusted based on the difference between the first coordinate value and the second coordinate value.

[0078] In addition, a second halftone processing can be applied to the resized original image. This allows the original image to be scaled proportionally when the user zooms in on the first image, ensuring that the size of the second image matches the user's desired size, and that the display effect of the second image is identical to that of the first image.

[0079] Figure 5 This is a schematic diagram of image scaling according to an embodiment of the present disclosure.

[0080] like Figure 5As shown, the following example illustrates the zoom operation triggered by the mouse. First, record the coordinates p1 / p2 / p3 / p4 of the four corners of the image. The coordinates of p1 can be represented as (x1, y1), the coordinates of p2 can be represented as (x2, y2), the coordinates of p3 can be represented as (x3, y3), and the coordinates of p4 can be represented as (x4, y4).

[0081] Then, place the mouse on the edge or corner of the image (represented by the value of the variable BorderNum), hold down the left mouse button and drag, triggering a background mouse event and recording the coordinates e(m,n) of the mouse position in real time. Table 1 shows the mapping between the variable BorderNum and the mouse position.

[0082] Table 1 Mapping between BorderNum and mouse position

[0083]

[0084] Figure 5 In the middle, drag the mouse in the lower right corner, BorderNum = 6, calculate the difference between point e and point p1: dx = m - x1, dy = n - y1.

[0085] After obtaining the difference values ​​dx and dy, the image size is adjusted to dx×dy.

[0086] It's important to note that mouse dragging is a continuous process, and the image resizing process described above can also be performed in a loop at millisecond speeds. From the user's perspective, the image continuously resizes as the mouse is dragged. Furthermore, during this millisecond-speed looping process, halftone processing can be applied to the scaled original image in each loop.

[0087] The simultaneous halftone processing of the original image during image scaling has the following effects: If halftone processing is applied only after scaling is complete, the user will not see the scaled image displayed on the e-paper screen during the scaling process. If the user is not satisfied with the halftone display after scaling, they may need to scale again, causing inconvenience. However, if halftone processing is applied in real-time during scaling, the user will see the scaled image displayed on the e-paper screen during the scaling process. Real-time halftone processing improves user convenience and reduces the probability of repetitive editing.

[0088] The image processing method provided in this disclosure allows for dragging and scaling the corners of an image while simultaneously performing halftone processing. This helps ensure that the image displayed to the user maintains the same display effect as the image displayed on electronic paper.

[0089] The following provides an illustrative example of color space conversion and halftone processing.

[0090] In some embodiments, the algorithms used for the first halftone processing and the second halftone processing may be the same or different.

[0091] In some embodiments, performing second halftone processing on the resized original image to obtain a second image may include: first, converting the color values ​​of pixel units in the resized original image to the color values ​​of a target preset color in a preset standard color space to obtain a color-converted original image; then, performing second halftone processing on the color-converted original image according to an error diffusion algorithm to obtain the second image.

[0092] Error diffusion, also known as dithering, is a halftone image processing algorithm. It distributes the quantization error of the center pixel to its unprocessed neighboring pixels, often used to convert multi-grayscale images into images with only a specified number of grayscale levels. Examples include two-grayscale black-and-white images, three-grayscale images (black-and-white-red, black-and-white-orange, black-and-white-yellow, black-and-white-blue, and black-and-white-green), and images with four or more grayscale levels. Halftone processing enhances image boundaries, resulting in a better visual effect.

[0093] Error diffusion algorithms include the Floyd-Steinberg dithering algorithm, the Stucki filter, and the JF Jarvis dithering algorithm. Among them, the Floyd-Steinberg dithering algorithm, proposed by Robert W. Floyd and Louis Steinberg in 1976, is widely used in image processing tools. The Floyd-Steinberg dithering algorithm can diffuse the quantization residual of the center pixel to the surrounding four pixels.

[0094] The following example uses the Floyd-Steinberg dithering algorithm to illustrate the process of processing a color image into an image with three colors.

[0095] In some embodiments, performing second halftone processing on the original color-converted image according to the error diffusion algorithm to obtain a second image may include the following operations.

[0096] For each pixel in at least a portion of the pixel units in the original image after color conversion, the following operations are performed sequentially to obtain a second image: the color value of the pixel unit is adjusted to the color value corresponding to the target preset color according to the color error, wherein the color error is the error between the display color of the pixel unit and the target preset color, and the target preset color is the color with the highest similarity to the display color of the pixel unit among the preset standard colors.

[0097] The preset standard colors can be a limited number of colors, such as three, four, five, or seven colors. Taking an e-paper display supporting white, black, and red as an example, the preset standard colors could be white, black, and red. Different colors can be represented using parameters in the RGB color space.

[0098] Those skilled in the art will understand that a color space, also known as a color model (or color system), is used to describe color in a generally acceptable manner under certain standards. Color spaces include RGB, CMY, HSV, and HSI color spaces, etc. It is understood that a defined color space refers to a predefined color space. Since this embodiment requires converting a color image into an image consisting of only a few colors, the original color data is converted into corresponding defined color data in a defined color space to enable better data processing of pixel colors.

[0099] It's important to note that since the RGB color space is the physical color mode of a monitor, any image displayed on a monitor will ultimately appear in the RGB color space. The displayed image is intended for display on an electronic paper screen. Therefore, the original color data is RGB color data. In other words, the original color data of the pixels in the original image is RGB color data. The RGB color space is designed based on the principle of color emission. The RGB color space includes three color channels: red, green, and blue. Each color has 256 levels of brightness. At 0, the brightness of that color channel is the weakest—that color channel is off—while at 255, the brightness of that color channel is the brightest. When the three grayscale values ​​are the same, different shades of gray are produced. That is, when all three grayscale values ​​are 0, it is the darkest black; when all three grayscale values ​​are 255, it is the brightest white. RGB values ​​refer to brightness and are represented using integers. Typically, each RGB has 256 levels of brightness, represented numerically from 0, 1, 2...254, 255.

[0100] For example, when there are multiple display units arranged in an array on a high-color-depth display screen, and each display unit may include three pixels (such as a red pixel, a green pixel, and a blue pixel), each pixel can have 256 display brightness levels. For example, red can be represented by the color value [255, 0, 0]. For example, white can be represented by the color value [255, 255, 255]. For example, black can be represented by the color value [0, 0, 0]. To facilitate the representation of each value in the color value, the following uses gray-scale values for representation.

[0101] It should also be noted that the parameters of different color spaces can be converted between each other. For example, in the HSV color space, the saturation S and value V of five colors, namely red, orange, yellow, green, and blue, are both 100%. According to the H value, the distribution ranges of red, orange, yellow, green, and blue when the saturation and value are both 100% can be locked. When H = 0, it represents red; when H = 30, it represents orange; when H = 60, it represents yellow; when H = 120, it represents green; when H = 240, it represents blue. When 0 < H < 30, an intermediate color can be obtained by the alternating appearance of red and orange, and as the H value increases, the probability of the appearance of red decreases and the probability of the appearance of orange increases. When 30 < H < 60, an intermediate color can be obtained by the alternating appearance of orange and yellow, and as the H value increases, the probability of the appearance of orange decreases and the probability of the appearance of yellow increases. And so on, the intermediate color between two adjacent colors, that is, the intermediate mixed color of two adjacent colors, should be formed by the alternating mixture of two adjacent colors, and the mixing ratio is determined according to the proximity of the H value. In addition, as the saturation S decreases, the proportion of white appearance increases, and as the value V decreases, the proportion of black appearance increases. Therefore, the proportion of each standard color in the RGB color space can be calculated according to the hue data H, saturation data S, and value data V of the set color, realizing the conversion between the HSV color space and the RGB color space.

[0102] In some embodiments, adjusting the color value of a pixel unit to the color value corresponding to a target preset color according to the color error may include the following operations.

[0103] First, calculate the similarity between the color value of the pixel unit and the color value of each color among multiple preset standard colors. Specifically, calculate the similarity S between the color value (r, g, b) of the current pixel unit and black (0, 0, 0), white (255, 255, 255), and red (255, 0, 0) respectively. For example, if the color value of the current pixel unit is represented as [r, g, b], and the color value of red is [255, 0, 0], the similarity between the color of the current pixel unit and red can be determined according to the difference between [r, g, b] and [255, 0, 0].

[0104] Then, a target preset standard color with the highest similarity to the pixel unit's color value is determined from multiple preset standard colors, and the difference between the pixel unit's color value and the color value of the most similar preset standard color is determined. Replacing the current pixel unit's color with the most similar preset standard color helps to maximize the preservation of color information in the color image. For example, the color value of the current pixel is replaced with the closest color (such as black, white, or red).

[0105] Next, the color value of the pixel unit is adjusted to correspond to the color value of the target preset standard color. For example, if the color value of a pixel unit is closest to red, then the color value of the pixel unit can be adjusted to the color value corresponding to red. Furthermore, the difference between the color value of the pixel unit and the color value of red can be obtained. This facilitates the conversion of a color image into an image composed of multiple standard color pixels, and also facilitates the diffusion of the difference to neighboring pixel units, further improving the display effect. For example, the difference (i.e., error) between the color value of a pixel unit in the original image and the color value of the replaced preset standard color is calculated, and the difference is diffused to adjacent pixels according to a predetermined ratio.

[0106] By performing the above three operations on each pixel unit in a top-to-bottom and left-to-right order, the image can be converted into a halftone image, such as a dot map that includes black, white, and red.

[0107] In some embodiments, a pixel unit includes at least two pixels.

[0108] Accordingly, calculating the similarity between the color value of a pixel unit and the color value of each of the multiple preset standard colors may include the following operations: for each of the multiple preset standard colors, perform the following operations in sequence until the difference calculation for all preset standard colors is completed.

[0109] First, calculate the sub-difference between the grayscale value of each pixel in at least two pixels and the corresponding grayscale value in the preset standard color. For example, if the color value of the current pixel unit is [125, 200, 100], the sub-differences between each grayscale value in the current pixel unit and the corresponding grayscale values ​​in the red color value [255, 0, 0] are (125-255), (200-0), and (100-0), respectively, which are -130, 200, 100.

[0110] Then, the difference between the color value of the pixel unit and the color value of the preset standard color is determined based on the sub-difference value. Specifically, the square or absolute value of the sub-difference value can be taken to remove the influence of negative numbers. For example, the difference can be represented by the following factors [(125-255)×(125-255), (200-0)×(200-0), (100-0)×(100-0)].

[0111] Next, the similarity between the color value of the pixel unit and the color value of the preset standard color is determined based on the difference. For example, the similarity S can be expressed as: (125-255)×(125-255)+(200-0)×(200-0)+(100-0)×(100-0). This gives the similarity of the current pixel unit's color to red. The smaller the value calculated by the above formula, the higher the similarity between the two colors. The calculation method for the similarity of the current pixel unit's color to black or white is similar to the above method and will not be repeated here. The target preset color of the current pixel unit can be determined in the above way, and the difference between the color value of the current pixel unit and the target preset color, i.e., the color error, can be obtained.

[0112] In some embodiments, color errors can be propagated to neighboring pixel units of the current pixel unit in the following manner.

[0113] For example, a filter can be used to adjust the color values ​​of neighboring pixel units based on color error. The filter may include a target unit and at least two weighted units located in the neighborhood of the target unit. Each of the at least two weighted units is assigned a weight value, which is related to the distance and / or relative position between each weighted unit and the target weighted unit. These weight values ​​are used to weight the color error and distribute it to the neighboring pixel units corresponding to the weighted unit to which the weight value belongs.

[0114] Specifically, the weight values ​​are determined by assigning them in descending order along the vertical direction from high to low, and along the horizontal direction from left to right, with the target weighted unit as the reference point.

[0115] Figure 6 This is a schematic diagram of a filter according to an embodiment of the present disclosure.

[0116] like Figure 6 As shown, the core of the error diffusion algorithm is a filter. Figure 6The symbol * in the diagram represents the target weighted unit corresponding to the current pixel unit. The error generated after converting the current pixel unit to black, white, or red is divided into 16 equal parts, meaning the color error is divided into 16 equal parts. Specifically, the weighted unit to the right of the target weighted unit has a weight of 7 parts, the weighted unit below the target weighted unit has a weight of 5 parts, the weighted unit to the lower left of the target weighted unit has a weight of 3 parts, and the weighted unit to the lower right of the target weighted unit has a weight of 1 part. It should be noted that dividing the error into 16 equal parts is only an example; the error can also be divided into fewer or more parts, such as 32 or 36 parts, depending on the image display effect. Furthermore, the method of spreading the error to four neighboring pixel units is also only an example; the error can also be spread to 11 neighboring pixel units, or even to the seven neighboring pixel units of the four pixel units adjacent to the current pixel unit. The error distribution of each neighboring pixel unit can be allocated according to the rule shown above (based on the target weighted unit, the distribution is carried out in descending order along the vertical direction from high to low and along the horizontal direction from left to right), which will not be listed here.

[0117] Figure 7 This is a schematic diagram of an error propagation process according to an embodiment of the present disclosure.

[0118] like Figure 7 As shown, the color error is divided into 16 equal parts. The pixel unit with a color error of [16, 16, 16] is the current pixel unit, which corresponds to the target weighted unit* of the filter. The weighted unit to the right of the target weighted unit* has an error diffusion weight of 7 parts. Therefore, after error diffusion, the color value of the pixel unit to the right of the current pixel unit is adjusted from [41, 34, 99] to [41+16×7 / 16, 34+16×7 / 16, 99+16×7 / 16]=[41+7, 34+7, 99+7]=[48, 41, 106]. The calculation method for the color value of other neighboring pixel units after error diffusion is similar to the above method and will not be listed here.

[0119] Figure 8 This is a schematic diagram illustrating the display effect after image processing according to an embodiment of the present disclosure.

[0120] like Figure 8 As shown, after the user scales the halftone image, its display effect and... Figure 3 The display effect of the middle (b) image is basically consistent, which effectively improves the convenience of users editing images.

[0121] In this embodiment, the image can be scaled by dragging its corners. Simultaneously with scaling, halftone processing can be applied to ensure that the image displayed to the user on a high-color-scale display is consistent with its display on electronic paper.

[0122] In some embodiments, the above method may further include the following operations before performing the first halftone processing on the original image.

[0123] First, obtain the cropping operation for the original image. Specifically, open the preview window to receive the image cropping operation.

[0124] Then, in response to the cropping operation on the original image, the original image is cropped to obtain a cropped third image, and the third image is used as either the original image or the first image.

[0125] Specifically, drag the corners of the selection box to select the desired portion.

[0126] Figure 9 This is a schematic diagram illustrating the effect of image selection and cropping according to an embodiment of the present disclosure.

[0127] like Figure 9 As shown, Figure (a) illustrates cropping a portion of the image, including the face, from the original image. Figure (b) shows an example of selecting the entire image from the original image. After completing the image selection and / or cropping, the cropped image can be saved to a local temporary folder, with the path saved to the parameter `path`.

[0128] In some embodiments, after cropping the original image to obtain the cropped third image, the above method may further include the following operation: adjusting the aspect ratio of the third image to the same aspect ratio as the original image or the first image.

[0129] Specifically, to prevent the image from being too large and exceeding the window's display area, and to maintain the aspect ratio of the cropped image, the image is adjusted to a default size (e.g., 100 pixels × 100 pixels). For example, this default size could be determined based on the selected image editing template. Alternatively, it could be the system default. Or, it could be a user-defined default size.

[0130] In some embodiments, adjusting the aspect ratio of the third image to the same aspect ratio as the original image or the first image may include the following operations.

[0131] First, determine the first width and first height information of the third image, and then determine the second width and second height information of the original image or the first image. For example, obtain the width of the screenshot as width0 = pixmap.width and the height as height0 = pixmap.height.

[0132] Then, the width ratio is determined based on the first width information and the second width information, and the height ratio is determined based on the first height information and the second height information. For example, the ratio of the default size (such as 100 pixels × 100 pixels) to the width and height of the screenshot is calculated, scale_w = 100 / width0, scale_h = 100 / height0.

[0133] Next, the smaller value between the width and height ratios is used as the image scaling ratio. For example, the smaller of scale_w and scale_h is used: scale = minimum(scale_w, scale_h).

[0134] Then, based on the image scaling ratio, the third width information corresponding to the first width information is calculated, and based on the image scaling ratio, the third height information corresponding to the first height information is calculated. For example, the new width newWidth = width0 × scale and the height newHeight = height0 × scale can be calculated for the image.

[0135] Next, the size of the third image is adjusted according to the third width and third height information. For example, the screenshot is resized according to the new width and height, maintaining the original aspect ratio of the image.

[0136] By adjusting the width and height ratios as described above, the distortion of images such as people in screenshots can be effectively reduced.

[0137] Figure 10 This is a schematic diagram illustrating image resizing according to an embodiment of the present disclosure.

[0138] like Figure 10 As shown, the height ratio of the cropped image to the original image size is 100 / 300 = 1 / 3. The width ratio is 100 / 150 = 2 / 3. The smaller of the height and width ratios is 1 / 3. Therefore, 1 / 3 is used as the image scaling ratio. Accordingly, the new image height is 300 × 1 / 3 = 100 (pixels), and the new image width is 150 × 1 / 3 = 50 (pixels).

[0139] In some embodiments, after obtaining the second image, the above method may further include the following operations.

[0140] First, it receives a region selection operation for the editable area of ​​the image editing template.

[0141] Then, in response to the region selection operation, the region to be edited is determined from the editable region, and at least a portion of the second image is displayed in the region to be edited.

[0142] Next, in response to a scaling operation on the area to be edited, while scaling the image displayed in the area to be edited, a third halftone processing is performed on the image displayed in the area to be edited. The algorithm for the third halftone processing can be the same as or different from the algorithms for the first and second halftone processing.

[0143] The above method allows for halftone processing of the image only in the user-selected area to be edited, which helps reduce the consumption of computing resources.

[0144] In some embodiments, the above method may further include the following operation: in response to detecting that multiple original images are displayed overlappingly, performing a first halftone processing and / or a second halftone processing on the topmost portion of the overlapping original images.

[0145] Specifically, halftone processing can be applied only to the topmost original image in the overlapping display area, which helps reduce the consumption of computing resources and energy. It should be noted that halftone processing can also be applied to the topmost and one or more layers of original images below it in the overlapping display area; this is not limited here.

[0146] In some embodiments, after obtaining the second image, the above method may further include the following operations.

[0147] First, it receives a region selection operation for the editable area of ​​the image editing template.

[0148] Then, in response to the region selection operation, the region to be edited is determined from the editable region, and at least a portion of the second image is displayed in the region to be edited.

[0149] In response to a scaling operation on the area to be edited, while scaling the image displayed in the area to be edited, the image displayed in the editable area is processed with a third halftone.

[0150] The above methods can refresh the editable area of ​​the entire window (template), perform halftone processing on all images, and help improve the consistency of display effects (such as pixel density) of all displayed images.

[0151] Figure 11 This is a schematic diagram of displaying an image in an image editing template according to an embodiment of the present disclosure.

[0152] like Figure 11As shown, multiple images of "pet dogs" are added to the image editing template. Each image has been halftone processed so that the images in the image editing template can be displayed on the electronic paper display screen with the same display effect.

[0153] Figure 12 FIG. is a schematic diagram of editing an image in an image editing template according to an embodiment of the present disclosure.

[0154] As Figure 12 shown, different from Figure 11 is that Figure 12 some of the images of "pet dogs" in Figure 12 have been scaled. For example, the image of the "pet dog" in the lower left corner has been enlarged and halftone processed. For example, during the process of enlarging the image of the "pet dog" in the lower left corner, only the image of the area selected by the user (i.e., the image of the "pet dog" in the lower right corner) can be halftone processed. For example, during the process of enlarging the image of the "pet dog" in the lower left corner, all the images displayed in the image editing template (i.e.,

[0155] all the images of "pet dogs" in

[0156] Figure 13 FIG. is a schematic diagram of adding text in an image editing template according to an embodiment of the present disclosure.

[0157] As Figure 13 shown, the user can add information such as text, numbers, or symbols in the image editing template to meet the user's personalized needs. Figure 13 Three Chinese characters "Wang" are added in

[0158] It should be noted that the images of the added text, numbers, or symbols can be halftone processed or not.

[0159] In some embodiments, after the above method adjusts the size of the original image and performs a second halftone process to obtain a second image, the following operations can also be included.

[0160] For example, a second image is displayed on the first display screen.

[0161] The first display screen includes, but is not limited to, at least one of: liquid crystal display (LCD), cathode ray tube (CRT) display, organic light-emitting diode (OLED) display, light-emitting diode (LED) display, and touch screen.

[0162] For example, a second image is sent to an electronic device coupled to a second display screen to control the second display screen to display the second image. The pixel unit of the second image includes pixels of two colors or pixels of three colors. The colors of the two-color pixels are the same as the colors supported by some pixels in the pixel unit of the second display screen, and the colors of the three-color pixels are the same as the colors supported by some pixels in the pixel unit of the second display screen.

[0163] The second display screen can be an electronic paper display screen.

[0164] refer to Figure 1 As shown, the first electronic device 110 can control the first display screen 120 to display the image-processed second image. Furthermore, the first electronic device 110 can also control the second display screen 120 (such as an electronic paper display screen) coupled thereto to display the image-processed second image. Additionally, the first electronic device 110 can send the image-processed second image to the second electronic device 130, thus facilitating the second electronic device 130 to control the second display screen 140 coupled thereto to display the image-processed second image.

[0165] The image processing method provided in this embodiment enables a first display screen to display a second image with the same display effect as a first image displayed on a second display screen, wherein the first display screen supports a greater number of colors than the second display screen can display.

[0166] Figure 14 This is a flowchart of a method for image processing according to an embodiment of the present disclosure.

[0167] like Figure 14As shown, in operation S1401, the user opens the electronic paper image editing software. In operation S1402, the user selects a blank electronic paper editing template (image editing template) of the desired size. In operation S1403, the user opens the image selection window. In operation S1404, the image is acquired. In operation S1405, the image can be cropped to obtain the desired image for display. In operation S1406, the image size is adjusted to the default size, such as 100 pixels × 100 pixels. In operation S1407, the electronic paper image editing software can perform halftone processing on the image. In operation S1408, the halftone processed image is displayed in the image editing template. If the user needs to adjust the image size, in operation S1409, the image can be scaled by dragging the corners. In operation S1410, the image is adjusted to the scaled size input by the user. During the image scaling process, in operations S1411~S1413, halftone processing can also be performed on the scaled image in real time. For example, when the image size changes or the refresh time is met, the scaled image is halftone-processed until it is determined that the user has completed the image scaling operation. In operation S1414, the processed image is displayed in the image editing template. This allows the halftone-processed image that meets the user's size requirements to be displayed in the image editing template.

[0168] The image processing method of this disclosure allows for the insertion of any number of images into the window of an image editing program, and the insertion images are then subjected to halftone processing. Furthermore, the inserted images can be scaled, for example, by placing the mouse on a corner of the image, pressing the right mouse button, and dragging the mouse. During image scaling, the original image is scaled first while dragging the mouse, and then halftone processing is applied to the scaled image, ensuring that the pixel density of the displayed image remains consistent with the image editing template (such as the editable area of ​​the image within the window). This ensures that the displayed effect of the image after processing on a high-color-scale display screen is consistent with the display effect refreshed on electronic paper.

[0169] Another aspect of this disclosure provides an image processing apparatus.

[0170] Figure 15 This is a block diagram of an image processing apparatus according to an embodiment of the present disclosure.

[0171] like Figure 15 As shown, the image processing device 1500 may include an original image acquisition module 1510, a first halftone processing module 1520, and a second halftone processing module 1530.

[0172] The original image acquisition module 1510 is used to acquire the original image.

[0173] The first halftone processing module 1520 is used to perform first halftone processing on the original image to obtain the first image.

[0174] The second halftone processing module 1530 is used to adjust the size of the original image and perform second halftone processing in response to detecting a scaling operation on the first image, thereby obtaining a second image. For example, the pixel density of the first image and the pixel density of the second image can be the same or similar.

[0175] According to an embodiment of this disclosure, the second halftone processing module 1530 is specifically configured to, in response to detecting a scaling operation on the first image, perform second halftone processing on the original image if a preset refresh condition is detected during the process of adjusting the size of the original image, to obtain a second image.

[0176] According to embodiments of this disclosure, the first halftone processing module 1520 and / or the second halftone processing module 1530 can perform halftone processing according to an error diffusion algorithm.

[0177] According to embodiments of this disclosure, the second halftone processing module 1530 may include a color space conversion unit and an error diffusion unit. The color space conversion unit converts the color values ​​of pixel units in the resized original image to the color values ​​of a target preset color in a preset standard color space, obtaining a color-converted original image. The error diffusion unit performs second halftone processing on the color-converted original image according to an error diffusion algorithm, obtaining a second image.

[0178] According to embodiments of this disclosure, the color space conversion unit is specifically used to perform the following operations sequentially for each pixel unit in at least a portion of the pixel units in the resized original image to obtain the color-converted original image: adjusting the color value of the pixel unit to a color value corresponding to a target preset color based on the color error, wherein the color error is the error between the display color of the pixel unit and the target preset color, and the target preset color is the color with the highest similarity to the display color of the pixel unit among preset standard colors.

[0179] According to embodiments of this disclosure, the color space conversion unit is specifically used to calculate the similarity between the color value of the pixel unit and the color value of each of a plurality of preset standard colors; determine the target preset standard color with the highest similarity to the color value of the pixel unit from the plurality of preset standard colors; and adjust the color value of the pixel unit to the color value corresponding to the target preset standard color.

[0180] According to embodiments of this disclosure, a pixel unit includes at least two pixels. Accordingly, the second halftone processing module 1530 is specifically configured to perform the following operations sequentially for each of a plurality of preset standard colors until the difference calculation for all preset standard colors is completed: calculating a sub-difference between the grayscale value of each of the at least two pixels and the corresponding grayscale value in the color value of the preset standard color; determining the difference between the color value of the pixel unit and the color value of the preset standard color based on the sub-difference; and determining the similarity between the color value of the pixel unit and the color value of the preset standard color based on the difference.

[0181] According to embodiments of this disclosure, the preset refresh conditions may include at least one of: receiving a scaling operation, reaching a preset refresh period, or the scaling operation ending.

[0182] According to an embodiment of this disclosure, the apparatus 1500 further includes: an image cropping module, configured to acquire a cropping operation for the original image before performing first halftone processing on the original image; and to crop the original image in response to the cropping operation for the original image to obtain a cropped third image, and to use the third image as the original image or the first image.

[0183] According to an embodiment of this disclosure, the device 1500 further includes: a height and width adjustment module, used to adjust the aspect ratio of the third image to the same aspect ratio as the original image or the first image after cropping the original image to obtain the cropped third image.

[0184] According to embodiments of this disclosure, the height-width adjustment module is specifically used to determine first width information and first height information of a third image, and to determine second width information and second height information of the original image or the first image; to determine a width ratio based on the first width information and the second width information, and to determine a height ratio based on the first height information and the second height information; to use the smaller value of the width ratio and the height ratio as the image scaling ratio; to calculate third width information corresponding to the second width information based on the image scaling ratio, and to calculate third height information corresponding to the second height information based on the image scaling ratio; and to adjust the size of the third image according to the third width information and the third height information.

[0185] According to embodiments of this disclosure, the original image acquisition module 1510 is specifically configured to determine an image editing template in response to a template acquisition operation for an image editing program; read an original image through the image editing program or call a shooting component to capture an original image in response to an image acquisition operation for the image editing program; and display the original image in the image editing template.

[0186] According to embodiments of this disclosure, the apparatus 1500 may further include: a region refresh module, configured to receive a region selection operation for an editable region of an image editing template after obtaining a second image; in response to the region selection operation, determine an editable region from the editable region, displaying at least a portion of the second image in the editable region; and in response to a scaling operation for the editable region, perform third halftone processing on the original image corresponding to the image displayed in the editable region during the scaling process.

[0187] According to embodiments of this disclosure, the apparatus 1500 may further include: an overall refresh module, configured to receive a region selection operation for an editable region of an image editing template after obtaining the second image; in response to the region selection operation, determine an editable region from the editable region, displaying at least a portion of the second image in the editable region; and in response to a scaling operation for the editable region, perform third halftone processing on the image displayed in the editable region during the scaling process of the image displayed in the editable region.

[0188] According to embodiments of this disclosure, the apparatus 1500 may further include: an overlapping image processing module, configured to perform a first halftone processing and / or a second halftone processing on the topmost portion of the overlapping original images in response to detecting that multiple original images are displayed overlappingly.

[0189] According to embodiments of this disclosure, the above-described apparatus 1500 may further include: a text editing module for acquiring text information; and editing text information in an editable area of ​​an image editing template.

[0190] According to embodiments of this disclosure, the second halftone processing module 1530 is further configured to: determine first coordinate values ​​of four vertices of the first image; determine second coordinate values ​​of the trigger point of the scaling operation in response to a scaling operation on the first image; determine the difference between the first coordinate value of the top-left vertex and the second coordinate value of the trigger point; adjust the size of the original image based on the difference between the first and second coordinate values; and perform second halftone processing on the resized original image.

[0191] According to embodiments of this disclosure, the apparatus 1500 further includes an image output module, configured to perform second halftone processing on the original image after resizing to obtain a second image, and then display the second image on a first display screen, wherein the pixel unit of the second image includes pixels of two colors or pixels of three colors, at least one of the two-color pixels is different from the color of each pixel in the pixel unit of the first display screen, and at least one of the three-color pixels is different from the color of each pixel in the pixel unit of the first display screen; and / or, to send the second image to an electronic device coupled to the second display screen to control the second display screen to display the second image, wherein the pixel unit of the second image includes pixels of two colors or pixels of three colors, the colors of the two-color pixels are the same as the colors supported by some pixels in the pixel unit of the second display screen, and the colors of the three-color pixels are the same as the colors supported by some pixels in the pixel unit of the second display screen.

[0192] According to embodiments of this disclosure, the first display screen includes at least one of the following: a liquid crystal display screen, a cathode ray tube display screen, an organic light-emitting diode display screen, a light-emitting diode display screen, and a touch screen.

[0193] According to embodiments of this disclosure, the second display screen includes electronic paper.

[0194] Figure 16 A schematic block diagram of an example electronic device 1600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0195] like Figure 16 As shown, device 1600 includes a computing unit 1601, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1602 or a computer program loaded into random access memory (RAM) 1603 from storage unit 1608. The RAM 1603 may also store various programs and data required for the operation of device 1600. The computing unit 1601, ROM 1602, and RAM 1603 are interconnected via bus 1604. Input / output (I / O) interface 1605 is also connected to bus 1604.

[0196] Multiple components in device 1600 are connected to I / O interface 1605, including: input unit 1606, such as keyboard, mouse, etc.; output unit 1607, such as various types of monitors, speakers, etc.; storage unit 1608, such as disk, optical disk, etc.; and communication unit 1609, such as network card, modem, wireless transceiver, etc. Communication unit 1609 allows device 1600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0197] The computing unit 1601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1601 performs the various methods and processes described above, such as image processing methods. For example, in some embodiments, the image processing method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1608. In some embodiments, part or all of the computer program may be loaded and / or installed on device 1600 via ROM 1602 and / or communication unit 1609. When the computer program is loaded into RAM 1603 and executed by the computing unit 1601, one or more steps of the image processing method described above may be performed. Alternatively, in other embodiments, the computing unit 1601 may be configured to perform image processing methods by any other suitable means (e.g., by means of firmware).

[0198] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0199] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0200] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0201] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0202] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0203] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other.

[0204] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0205] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. An image processing method comprising: obtaining an original image; performing first halftone processing on the original image to obtain a first image; and in response to detecting a zoom operation on the first image, performing second halftone processing on the original image after adjusting a size of the original image to obtain a second image; wherein the performing second halftone processing on the original image after adjusting the size of the original image to obtain the second image comprises: in response to detecting the zoom operation on the first image, during the adjusting of the size of the original image, if it is detected that a preset refresh condition is met, performing second halftone processing on the original image to obtain the second image; wherein the performing second halftone processing on the original image to obtain the second image comprises: converting color values of pixel units in the original image after the size adjustment to color values of a target preset color in a preset standard color space to obtain a color-converted original image; and performing second halftone processing on the color-converted original image according to an error diffusion algorithm to obtain the second image; wherein the converting the color values of the pixel units in the original image after the size adjustment to the color values of the target preset color in the preset standard color space to obtain the color-converted original image comprises: for each of at least some of the pixel units in the original image after the size adjustment, sequentially performing the following operations to obtain the color-converted original image, adjusting the color value of the pixel unit to a color value corresponding to a target preset color according to a color error, wherein the color error is an error between a display color of the pixel unit and the target preset color, and the target preset color is a color in the preset standard color that is most similar to the display color of the pixel unit. The adjusting the color value of the pixel unit to the color value corresponding to the target preset color according to the color error comprises:

2. The method of claim 1, wherein, calculating a similarity between the color value of the pixel unit and a color value of each of a plurality of preset standard colors; determining a target preset standard color from the plurality of preset standard colors that is most similar to the color value of the pixel unit; and adjusting the color value of the pixel unit to the color value corresponding to the target preset standard color. The pixel unit comprises at least two pixels.

3. The method of claim 2, wherein, The calculating the similarity between the color value of the pixel unit and the color value of each of the plurality of preset standard colors comprises, for each of the plurality of preset standard colors, sequentially performing the following operations until the difference value calculation for all preset standard colors is completed, respectively calculating a sub-difference value between a gray scale value of each of the at least two pixels and a corresponding gray scale value in the color value of the preset standard color; determining a difference value between the color value of the pixel unit and the color value of the preset standard color based on the sub-difference values; and determining the similarity between the color value of the pixel unit and the color value of the preset standard color based on the difference value. ​ 4. The method of claim 1, wherein, The preset refresh condition comprises at least one of receiving a zoom operation, reaching a preset refresh period, and ending the zoom operation.

5. The method of claim 1, further comprising: Before the first halftone processing is performed on the original image, an operation of cropping the original image is acquired; and in response to the operation of cropping the original image, the original image is cropped to obtain a cropped third image, and the third image is taken as the original image or the first image.

6. The method of claim 5, further comprising: After the original image is cropped to obtain the cropped third image, an aspect ratio of the third image is adjusted to be the same as that of the original image or the first image.

7. The method of claim 6, wherein, The adjusting of the aspect ratio of the third image to be the same as that of the original image or the first image comprises: determining first width information and first height information of the third image, and determining second width information and second height information of the original image or the first image; determining a width ratio based on the first width information and the second width information, and determining a height ratio based on the first height information and the second height information; taking a smaller value of the width ratio and the height ratio as an image zoom ratio; calculating third width information corresponding to the first width information based on the image zoom ratio, and calculating third height information corresponding to the first height information based on the image zoom ratio; and adjusting a size of the third image according to the third width information and the third height information.

8. The method of any one of claims 1-7, wherein, The acquiring of the original image comprises: in response to a template acquisition operation, determining an image editing template; in response to an image acquisition operation, acquiring the original image or calling a shooting component to shoot the original image; and displaying the original image in the image editing template.

9. The method of claim 8, further comprising: After the second image is obtained, an area selection operation for an editable area of the image editing template is received; in response to the area selection operation, a to-be-edited area is determined from the editable area, at least part of the second image being displayed in the to-be-edited area; and in response to a zoom operation for the to-be-edited area, a third halftone processing is performed on an original image corresponding to an image displayed in the to-be-edited area in a zooming process of the image.

10. The method of claim 8, further comprising: in response to detecting a plurality of original images and an overlapped display, performing the first halftone processing and / or the second halftone processing on an uppermost part of the overlapped displayed original images.

11. The method of claim 8, further comprising: acquiring text information; and displaying the text information in an editable area of the image editing template. The adjusting of the size of the original image in response to the detection of the zoom operation for the first image and the second halftone processing comprises:

12. The method according to any one of claims 1 to 7, wherein, determining first coordinate values of four vertices of the first image; in response to the zoom operation for the first image, determining second coordinate values of a trigger point of the zoom operation; ​ determining a difference between a first coordinate value of an upper-left corner of the four corners and a second coordinate value of the trigger point; adjusting a size of the original image based on the difference between the first coordinate value and the second coordinate value; and performing a second halftone processing on the original image after the size adjustment.

13. The method of any one of claims 1 to 7, further comprising: after the second halftone processing on the original image after the size adjustment to obtain a second image, displaying the second image on the first display screen; and / or, sending the second image to an electronic device coupled with a second display screen to control the second display screen to display the second image, wherein a pixel unit of the second image includes two-color pixels or three-color pixels, colors of the two-color pixels are respectively the same as colors supported by part of pixels in a pixel unit of the second display screen, and colors of the three-color pixels are respectively the same as colors supported by part of pixels in a pixel unit of the second display screen.

14. The method of claim 13, wherein, The first display screen includes at least one of a liquid crystal display screen, a cathode ray tube display screen, an organic light-emitting diode display screen, a light-emitting diode display screen, and a touch screen.

15. The method of claim 13, wherein, The second display screen includes electronic paper.

16. An image processing apparatus, comprising: an original image acquisition module configured to acquire an original image; a first halftone processing module configured to perform a first halftone processing on the original image to obtain a first image; and a second halftone processing module configured to, in response to detecting a zoom operation on the first image, perform a second halftone processing on the original image after adjusting a size of the original image to obtain a second image; wherein the second halftone processing module includes: a second halftone processing submodule configured to, in response to detecting a zoom operation on the first image, perform a second halftone processing on the original image during the adjustment of the size of the original image to obtain the second image if a preset refresh condition is detected; wherein the second halftone processing submodule includes: a color conversion unit configured to convert color values of pixel units in the original image after the size adjustment to color values of a target preset color in a preset standard color space to obtain a color-converted original image; and a second halftone processing unit configured to perform a second halftone processing on the color-converted original image according to an error diffusion algorithm to obtain the second image; wherein the color conversion unit is configured to, for each of at least part of the pixel units in the original image after the size adjustment, sequentially perform the following operations to obtain the color-converted original image: adjusting a color value of the pixel unit to a color value corresponding to the target preset color according to a color error, wherein the color error is an error between a display color of the pixel unit and the target preset color, and the target preset color is a color in the preset standard color that has the highest similarity to the display color of the pixel unit.

17. An electronic device, comprising: at least one processor; and a memory coupled with the at least one processor; wherein The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 15.

18. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are for causing the computer to perform the method of any one of claims 1 to 15.

19. A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1 to 15.

Citation Information

Patent Citations

  • Method for transforming image dimension

    CN1595450A