Image processing device, control method, and program
The image processing apparatus addresses image quality degradation by acquiring transparency information and adjusting image processing based on pixel transparency, ensuring high-quality output.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- CANON KK
- Filing Date
- 2022-10-18
- Publication Date
- 2026-06-29
AI Technical Summary
Existing image processing techniques degrade image quality due to undefined color information in fully transparent pixels, leading to issues like overexposure or blown-out highlights.
An image processing apparatus and method that acquires transparency information, calculates the percentage of an image area occupied by specific colors, and performs tailored image processing based on this information to suppress degradation by adjusting or deleting color information in fully transparent areas.
The solution effectively prevents image degradation by optimizing image processing for fully transparent pixels, ensuring accurate and high-quality image output.
Smart Images

Figure 0007881450000001 
Figure 0007881450000002 
Figure 0007881450000003
Abstract
Description
Technical Field
[0001] This embodiment relates to an image processing apparatus, a control method, and a program.
Background Art
[0002] Conventionally, there are various image processing applications that automatically perform color adjustment of an image, detection of a person in the image, etc. by analyzing the image. Some of these applications perform color correction processing to correct the color tone so that the entire image area or an area where a person appears becomes brighter. When executing such image processing, the RGB values (Red / Green / Blue values) of each pixel forming the image are extracted. Then, the obtained color information (RGB values) is input into various calculation formulas and algorithms, and the RGB values after image processing are output. Also, the calculation formulas and algorithms used in image processing often use the RGB values of the entire image area or the peripheral area of the pixel to be processed as input parameters.
[0003] Conventionally, there is an image format that holds "transparency information" in order to make a part of an image "completely transparent" or "semi-transparent". For example, PNG (Portable Network Graphics) holds an "Alpha value" representing the transparency in addition to the RGB values. In PNG, usually, when the Alpha value is "0", it is "completely transparent", when the Alpha value is the "maximum value", it is "completely opaque", and when it is neither of these values, it is "semi-transparent". By the "transparency information", for example, by making the corner area of an image completely transparent, it becomes possible to form a round image and execute screen display or printing. Also, for a photograph of a person, by making the background area "completely transparent", it is possible to form an image with only the person cut out. Furthermore, there are various applications that add and process "transparency information" to an image for which these processes are possible.
[0004] Pixels that are "semi-transparent" retain color information such as RGB values that form the image, but the color information of pixels with "transparency information" that are "fully transparent" (hereinafter referred to as "fully transparent pixels") is undefined. Therefore, depending on the color content, it may lead to a degradation of image quality after image processing. For example, the RGB values of "fully transparent" pixels may all be filled with black, where "Red=0, Green=0, Blue=0". When performing image processing to correct the brightness of the entire image, where the more pixels with darker colors there are, the more bright the correction is made, the following can occur. That is, for non-transparent pixels (hereinafter referred to as "non-transparent pixels"), the Red, Green, and Blue values may all be at their maximum (for example, 255), resulting in white, and it is possible that part or all of the non-transparent area may be "blown out". In other words, even if it is visible to the naked eye, when actually photographed, the highlights (bright parts) may be completely white. For this reason, according to the technology disclosed in Patent Document 1, the average value of the RGB values of "non-transparent pixels" is calculated, and this calculated average value is set for the RGB values of all "fully transparent pixels". [Prior art documents] [Patent Documents]
[0005] [Patent Document 1] Japanese Patent Publication No. 2005-196444 [Overview of the project] [Problems that the invention aims to solve]
[0006] In recent years, there has been a growing demand for image processing techniques that minimize image degradation.
[0007] Therefore, the object of the present invention is to provide an image processing apparatus, a control method, and a program capable of suppressing image degradation. [Means for solving the problem]
[0008] To achieve the above objective, the program of the present invention provides a computer for an image processing apparatus capable of performing image processing on an received image. A first acquisition means for acquiring transparency information indicating the transparency state of each pixel of the received image, A second acquisition means for acquiring color information for each pixel of the image from which the transparency information has been acquired, When transparency information is obtained by the first acquisition means, a third acquisition means obtains the percentage of the image area occupied by a specific color by referring to the acquisition result of the second acquisition means, The third acquisition means is characterized in that, if the percentage acquired by the third acquisition means is less than a first threshold, it performs a first image processing based on the color information of pixels throughout the entire image, and if the percentage acquired by the third acquisition means is greater than or equal to the first threshold but less than a second threshold greater than the first threshold, it deletes at least a portion of the color information region and performs a second image processing. [Effects of the Invention]
[0009] According to the present invention, the effect of achieving image processing with suppressed image degradation can be obtained. [Brief explanation of the drawing]
[0010] [Figure 1] This is a diagram of the system configuration. [Figure 2] This is an explanatory diagram regarding the pattern of the transparent area. [Figure 3] This is a flowchart showing the process of the first embodiment. [Figure 4] This is an explanatory diagram of the first embodiment. [Figure 5] This is a flowchart showing the process of the second embodiment. [Figure 6] This is an explanatory diagram illustrating an example of a monitor screen with an image file to be corrected as input. [Modes for carrying out the invention]
[0011] The embodiments of the present invention will be described in detail below with reference to the drawings. However, the configurations described in the following embodiments are merely illustrative, and the scope of the present invention is not limited to the configurations described in the embodiments. First, the first embodiment of the present invention will be described.
[0012] <Information Processing System> Referring to Figure 1, the configuration of the system used in this embodiment will be described. The information processing device 1 has the function of analyzing an input image and executing predetermined image processing. The predetermined image processing is, for example, correction processing such as color correction of the image. As shown in Figure 1, the information processing device 1 has a ROM 10, a RAM 11, and a CPU 12. The information processing device 1 also has an input / output interface (not shown) for connecting to a monitor 2, a printer 3, an input device 4, a storage device 5, and a network 50, and can be implemented with, for example, a single PC. In this embodiment, since the external server 100, including the program execution server 110, performs the image processing, the external server 100 (or program execution server 110) may also be referred to as the image processing device.
[0013] The CPU 12 is the central processing unit and controls the entire information processing device 1 by executing the operating system program (hereinafter referred to as "OS") stored in the storage device 5, ROM 10, and RAM 11. Furthermore, the CPU 12 realizes the various functions of the information processing device 1 by executing the program stored in ROM 10. As a result, calculations and processing of necessary information and control of various hardware components are performed. ROM 10 is a read-only memory where various programs are stored. RAM 11 is a read-write random-access memory that functions as the CPU 12's work memory and stores programs read from ROM 10.
[0014] Monitor 2 is a display device that displays images output by the information processing device 1. Printer 3 is a printing device that prints out images output by the information processing device 1. Input device 4 is an input device such as a keyboard or pointing device for operating the information processing device 1, and also has the function of acquiring images from an external USB memory device, an external HDD device, etc. Depending on the configuration of input device 4, it may be integrated with monitor 2, and input operations may be performed by directly touching monitor 2. Storage device 5 is a storage device such as an HDD or SSD that stores input images and images processed and output by the information processing device 1.
[0015] In the configuration diagram shown in Figure 1, the information processing device 1, monitor 2, input device 4, and storage device 5 are shown as separate components. However, depending on the configuration of the information processing device 1, the monitor 2, input device 4, and storage device 5 (which may be shared with the RAM of the information processing device 1) may be configured as a single unit. The network 50 is a communication network that enables communication between the information processing device 1 and the external server 100. For example, this could be the Internet communication network, but the network 50 can be wired or wireless.
[0016] The external server 100 includes a program execution server 110 and a storage server 120. It also has an input / output interface (not shown) for connecting to a network 50 such as the Internet. The program execution server 110 executes some of the processing or equivalent processing performed by the information processing device 1 as needed. The program execution server 110 also provides programs to be displayed in the browser application of the information processing device 1. The storage server 120 holds images transferred from the information processing device 1 via the network 50, or images acquired from the external Internet via the network 50, when the capacity of the storage device 5 is insufficient. The program execution server 110 and the storage server 120 may be implemented as physically separate devices, or they may be implemented as a single server device.
[0017] <First Embodiment> Here, an example of a problem will be described. When the area of "fully transparent pixels" is large, the average RGB values of a large number of "non-transparent pixels" are input into the image processing calculation formula or algorithm. As a result, there is a problem that the calculation load becomes extremely large and normal image processing cannot be performed. Also, depending on the application that adds the aforementioned "transparency information", there are cases where only the information of the Alpha value is added and the RGB values are left in the pixels that have been made transparent.
[0018] In the case of an image processed in this way, the RGB values of "fully transparent pixels" are replaced with the average values of "non-transparent pixels", and there are cases where accurate image processing cannot be performed. Therefore, when performing image processing based on the color information of the entire image or the processing target pixels adjacent to the processing target, there has been a demand for a method to prevent image degradation caused by "fully transparent pixels".
[0019] Next, referring to FIGS. 1 to 4, a process for preventing image degradation caused by "transparency information" when performing image processing based on the information of the entire image or the processing target pixels will be described. FIG. 2 is an explanatory diagram of a screen showing an original image (hereinafter also referred to as "source image") and the state with "transparency information" added and the color pattern of the transparent area. Image 200 shows an "unprocessed" photo (source image) of a person. Image 201 shows the state where the background of the person has been made "fully transparent" by the aforementioned image processing application.
[0020] Image 210 shows the state where the RGB values of the transparent area of Image 201 are black with "Red = 0, Green = 0, Blue = 0". Image 211 shows the state where the RGB values of the transparent area of Image 201 are white with "Red = maximum value, Green = maximum value, Blue = maximum value". Image 212 shows the state where the RGB values that form the image (source image) before processing the background to be transparent remain in the RGB values of the transparent area of Image 201.
[0021] In this embodiment, an example of a resolution process for image 210 in which the transparent area is black will be described. Furthermore, in the image processing algorithm in this embodiment, only RGB values are used as input parameters, without including "transparency information" such as Alpha values. In other words, it is assumed that correction calculations are performed based on the brightness of the entire image and the RGB values around the pixels to be corrected, and image data consisting only of RGB values is output. For this reason, when using an algorithm that performs image processing including "transparency information" or an algorithm that outputs an image including "transparency information" as the processing result, steps S303 and S309 in Figure 3, which will be described below, become unnecessary.
[0022] In this type of image and image processing algorithm, the process by which the program execution server 110 performs image processing on an image containing "transparency information" will be explained with reference to the explanatory diagrams in Figures 2 and 4, and the flowchart in Figure 3.
[0023] Figure 6 shows screen 601 of monitor 2 with an image file to be corrected input. Screen 601 is displayed, for example, when the program execution server 110 provides a display program (e.g., HTML) to the browser application of the information processing device 1. Image 602 shows the image data imported into the browser application. If multiple images are imported, thumbnail images of the multiple image data are displayed. Image 603 is the image to be automatically corrected. If the user checks the checkbox for automatic photo correction 604 on screen 601, the flowchart in Figure 3 is started. As described above, in this embodiment, Figure 3 is executed by the program execution server 110. Also, in this embodiment, the image data imported into screen 601 is uploaded from the information processing device 1 to the program execution server 110.
[0024] First, in S301, the program execution server 110 obtains the "transparency information" for each pixel of the input image. Here, "transparency information" is information indicating the transparency state of the image pixels, such as "fully transparent," "fully opaque," or "semi-transparent." As mentioned above, since the image data has been uploaded to the program execution server 110, the program execution server 110 can execute each step in Figure 3 using the uploaded image data. The program execution server 110 scans all pixels and obtains the Alpha value of each pixel. Next, in S302, the program execution server 110 determines whether or not there is "transparency information." For example, if the program execution server 110 determines in S301 that no Alpha value exists (NO in S302), it determines "no transparency information." Another example is that it can be checked from the image format. For example, the program execution server 110 determines "no transparency information" if the image data is a 24-bit RGB color model, and "transparency information present" if the image data is a 32-bit RGBA color model. Another example is the addition of "transparency information" to the CMYK color model. If the image format is application-specific and allows for the addition of transparency information, the program execution server 110 analyzes the image information, such as the presence or absence of a transparency layer, to confirm the presence or absence of "transparency information."
[0025] If the program execution server 110 determines that there is "no transparency information" (NO in S302), the process in Figure 3 proceeds to S390. The flowchart in Figure 3 ends when the program execution server 110 outputs the image processed for the image without "transparency information" to the storage server 120. On the other hand, if the program execution server 110 determines that there is "transparency information" (YES in S302), the process proceeds to S303. From here, we will explain what happens when the process proceeds to S303.
[0026] In S303, the program execution server 110 stores the "transparency information" acquired in S301 in the storage server 120. Specifically, one method is to store the position and coordinates of pixels in the image area and their Alpha values as a set. As another example, if the Alpha values of each pixel in the image are either minimum (completely transparent) or maximum (completely opaque), an image for adding Alpha values is created, output as an image file, and stored in the storage server 120. For example, using a Python image processing library such as Pillow, only the Alpha values are extracted to create a gray image. In this mask image, pixels that are "completely transparent" are usually black, and pixels that are "completely opaque" are white. As another example of an image with added Alpha values, a binary mask image is created where "completely transparent" pixels are "0" and "completely opaque" pixels are "1". In image 201 in Figure 2, if the background is completely transparent and the area of the person is completely opaque, the Alpha values of the pixels in the background area will be the minimum value, and the Alpha values of the pixels in the area of the person will be the maximum value. In this case, the Alpha values of each pixel in image 201 will be either the minimum or the maximum value. Therefore, the program execution server 110 creates an image for adding an Alpha value in which the pixels in the background area are completely transparent and the pixels in the area of the person are completely opaque, and stores it in the storage server 120.
[0027] Next, in S304, the program execution server 110 acquires color information for each pixel of the image from which "transparency information" has been acquired. For example, it scans each pixel and acquires color information such as RGB values, grayscale values, monochrome binary values, CMYK values (Cyan / Magenta / Yellow / Key Plate values), and HSB values (hue / saturation / brightness values) depending on the image processing algorithm and image format. The program execution server 110 only needs to acquire one or more values from among RGB values, grayscale values, monochrome binary values, CMYK values, and HSB values, depending on one of the calculation formulas, algorithms, and image formats used in image processing.
[0028] Next, in S305, the program execution server 110 calculates the percentage of the image area occupied by black regions, which are "completely transparent pixels." Basically, the program execution server 110 obtains the percentage of the image area occupied by a specific color by referring to the results of acquiring the color information of each pixel in S304. Specifically, the program execution server 110 scans the color information of all pixels in the image data to obtain the cumulative value of the "number of black pixels" where "Red=0, Green=0, Blue=0," and calculates the ratio of this cumulative value to the total number of pixels. At this time, if you do not want to include the black of "non-transparent pixels" in the black region, even if "Red=0, Green=0, Blue=0," if the Alpha value is not the minimum (not "completely transparent"), it may be excluded from the cumulative count of black pixels. For example, in Figure 2, if you do not want to include the black region contained in the person area, only the color information of each pixel in the background area will be acquired as the cumulative value.
[0029] Another method for determining the proportion of black areas within an image is to use a frequency distribution. For example, with 256 RGB values, the calculation "256 × 256 × 256" yields "16,777,216" patterns. You can either use all of these color patterns as classes, or create classes with a range of RGB values, such as "R=0~10, G=0~10, B=0~10," and calculate the frequency distribution of the RGB values across the entire image. Then, by calculating the relative frequency of classes that include "Red=0, Green=0, Blue=0," you can determine the proportion.
[0030] Next, in S306, the program execution server 110 determines whether the proportion of the black area acquired in S305 to the entire image is equal to or greater than a predetermined threshold (hereinafter referred to as "threshold 1"). If the program execution server 110 determines that the proportion of the black area to the entire image is less than "threshold 1" (NO), it proceeds to S391. On the other hand, if the program execution server 110 determines that the proportion of the black area to the entire image is equal to or greater than "threshold 1" (YES), it proceeds to S307. From here, we will explain the case where it proceeds to S391. In S391, the program execution server 110 performs image processing using the pixel color information of the entire image, and then proceeds to S309. In S309, the program execution server 110 adds the "transparency information" held in S303 to the processed image (details will be described later), and when it outputs it to the storage server 120, the series of processes shown in the flowchart of Figure 3 is completed. Furthermore, when using image processing algorithms that are prone to image quality degradation due to black areas or other solid color areas, it is advisable to set "Threshold 1" to a small value.
[0031] From here, we will explain the case where the program proceeds to S307 based on the determination made in S306. In S307, the program execution server 110 determines whether the proportion of the black area acquired in S305 to the entire image is equal to or greater than a predetermined threshold (hereinafter referred to as "threshold 2"). Note that "threshold 2" is a larger value than "threshold 1". If the program execution server 110 determines that the proportion of the black area to the entire image is less than "threshold 2" (NO), the program proceeds to S308. On the other hand, if the program execution server 110 determines that the proportion of the black area to the entire image is equal to or greater than "threshold 2" (YES), the program proceeds to S310.
[0032] From here, we will explain the case where the process proceeds to S308 in the judgment in S307. In S308, the program execution server 110 reduces (or deletes) the black area, which is the "completely transparent pixel area," and performs image processing. The first specific example of S308 (Specific Example 1) is to reduce the amount of black input to the calculation formulas and algorithms used in image processing. For example, in the process of the algorithm, the average of the RGB values of the entire image is usually calculated by dividing the sum of the RGB values of all pixels by the total number of pixels. However, in this process (S308), for example, the program execution server 110 calculates the frequency distribution (histogram) of color information explained in S304 and reduces the frequency of the class indicating black to less than or equal to the average value of the frequency of the class that does not include black. Then, the program execution server 110 uses the histogram to calculate the total number of RGB values by adding the sum of the RGB values after "reducing the total number of black area pixels" and the sum of the RGB values of "non-transparent pixels." Then, the program execution server 110 divides the calculated total number by the subtracted value (number of pixels after subtraction), which is obtained by subtracting the "number of black area pixels that were reduced" from the total number of pixels.
[0033] Furthermore, a second specific example of S308 (Specific Example 2) is to not input black pixels into the calculation formulas or algorithms used in image processing. For example, when calculating the average value of 8 pixels surrounding the pixel to be processed in the process of the algorithm, the average value is calculated after excluding the black pixels from the 8 pixels. A third specific example of S308 (Specific Example 3) is to extract a rectangular region from the input image that includes all "non-transparent pixels" and minimizes the number of black pixels, and then perform image processing on that region. For example, this could involve extracting the region so that the top and bottom edges and left and right edges of the "non-transparent pixels" form the outline. To explain this in more detail using Figure 4, image 400 is extracted from image 210 in Figure 2 as shown in the third specific example. The program execution server 110 performs the same image processing on the extracted image 400 in Figure 4 as described in Specific Example 1 or Specific Example 2. After that, the program execution server 110 can restore the image to have the same width and height as the input image by overlaying the processed extracted image on top of the input image at the extraction position.
[0034] In addition, the amount by which the black area is reduced in S308 may be an amount such that the proportion of the black area to the entire image is less than the "threshold 1" in S306, or an amount such that it is less than or equal to a predetermined reduction ratio, such as reducing it to 10% or less of the total number of "non-transparent pixels". In this way, the program execution server 110 may reduce the number of "fully transparent" pixels to a predetermined ratio and then perform the image processing in S308. This makes it possible to obtain an average value with the influence of black suppressed.
[0035] Next, in S309, the program execution server 110 adds the "transparency information" that it held in S303. The algorithm in this embodiment outputs image data containing only RGB values, so it is necessary to restore the "transparency information". If the program execution server 110 has stored the position and coordinates of pixels in the image region and their Alpha values as a set, it converts the processed image into an image format that can store Alpha values, such as the RGBA color model. After that, the program execution server 110 can restore the "transparency information" by setting Alpha values corresponding to the position and coordinates of each pixel. Here, we will explain the case where the program execution server 110 has extracted only the Alpha values and created an image for adding gray Alpha values. In this case, the program execution server 110 can restore the "transparency information" by adding Alpha values based on the pixel values of the gray image to the processed image using a Python image processing library such as Pillow.
[0036] If a binary mask image for assigning alpha values was created, with "0" representing "completely transparent" pixels and "1" representing "completely opaque" pixels, the program execution server 110 uses a Python image processing library such as Pillow to copy the processed image and create an RGBA color model image with the "maximum" alpha value assigned to all pixels. The program execution server 110 then restores the "transparency information" by compositing only the parts of the binary mask image that are "1" with the processed image. In this case, pixels with a mask image of "1" have the "maximum" alpha value set, and pixels with a mask image of "0" have the "minimum" alpha value set.
[0037] The series of processes shown in the flowchart of Figure 3 is terminated when the image with restored "transparency information" is output to the storage server 120. The image with the image processing applied, output to the storage server 120, is displayed in the browser application of the information processing device 1. For example, it is displayed in image 603 in Figure 6.
[0038] From here, we will explain the case where the process proceeds to S310 based on the judgment in S307. If the area of the "non-transparent region" is very small, it is considered that image processing is impossible or unnecessary. One reason for this is that, for example, because the area of the "non-transparent pixels" is small, the image processing algorithm may not be able to perform normal calculations due to insufficient input data. Also, even if image processing is performed, the effect of the image processing may not be visible in the image processing result display on monitor 2 or the print result on printer 3. For this reason, in S310, the program execution server 110 outputs information indicating that image processing was not performed without performing the image processing. Specifically, the program execution server 110 returns a message indicating that image processing was not performed, or a pre-set response code for unprocessed information indicating that image processing was not performed, to the source of the information processing device 1. As another example, the program execution server 110 may output the uploaded image to the storage server 120 in an unprocessed state. Once the processing in S310 is complete, the series of processes shown in the flowchart of Figure 3 are completed.
[0039] Furthermore, it is preferable that "Threshold 2" be a value that ensures a sufficient area of "non-transparent region" that the image processing algorithm can process. Alternatively, it is preferable that it be a value calculated from the relationship between the output resolution of monitor 2 and printer 3 and "mm" that ensures a sufficient area for the color difference on "non-transparent pixels" to be visually observed in the monitor display or print result. Also, "Threshold 2" should be a value greater than "Threshold 1".
[0040] In this embodiment, the explanation was given on the premise that all "completely transparent pixels" are black, but even if they are all white or other colors, the same effect can be obtained by replacing the black parts with the parts of the other colors. Furthermore, if there are multiple "completely transparent pixels," such as black and white, the same effect can be obtained by repeating the processes in S305, S306, S307, and S308 in Figure 3 for the number of colors of the "completely transparent pixels." However, if the RGB values that formed the original image remain in the "completely transparent pixels," as in image 212 in Figure 2, it is desirable to apply the second embodiment described below. Note that the image processing shown in S391, S308, and S309 is, for example, image correction processing such as analyzing the image and performing various processing and color correction processing.
[0041] <Second Embodiment> Referring to Figures 3 and 5, a desirable image processing method will be described when RGB values that form the original image, such as a photograph, remain in the "completely transparent pixel area," as shown in image 212 of Figure 2. The flowchart shown in Figure 5 is started when the program execution server 110 completes the processing in S304 in the first embodiment. S501 is a process inserted between S304 and S305. First, in S501 in Figure 5, the program execution server 110 determines whether or not RGB values that form the original image, which is the image before "transparency information" is added to the "completely transparent pixels," remain.
[0042] As a specific method, similar to the explanation in S305 of the first embodiment, a frequency distribution of RGB values across the entire image is generated. If there are no classes with particularly high frequencies, it is considered that not all "completely transparent pixels" are black or white. Therefore, the program execution server 110 can determine that the original image remains. Here, "high frequency" refers to exceeding a specific threshold, for example. Another specific method is that if the metadata of the input image contains information indicating that it was processed by an application that does not change RGB values when adding "transparency information," it can be determined that the RGB values that form the image remain in the "completely transparent pixels."
[0043] Furthermore, if an application capable of adding "transparency information" is installed, the application should not change the RGB values when adding "transparency information." This allows it to be determined that the RGB values forming the original image remain in the "fully transparent pixels" when executing the process of the first embodiment. Alternatively, in a released application, if it is implemented from a certain version onwards to not change the RGB values when adding "transparency information," the application version should be recorded in the image metadata at the same time. Also, when executing the process of the first embodiment, the metadata is retrieved and the presence or absence of version information and the version value are checked.
[0044] This allows the program execution server 110 to determine whether or not the RGB values that formed the original image remain in the "completely transparent pixels". If the program execution server 110 determines that the RGB values that formed the original image remain in the "completely transparent pixels" (YES in S501), the process proceeds to S391 in Figure 3, and image processing is performed using the pixel color information of the entire image. Therefore, it becomes possible to perform image processing using the RGB values that formed the original image of the entire image, enabling accurate image processing. On the other hand, if the program execution server 110 determines that the RGB values that formed the image do not remain (NO in S501), the process proceeds to S305, and the percentage of the image area occupied by the color of the "completely transparent pixels" is determined.
[0045] As described above, the program execution server 110 can be configured to perform image processing based on the color information of all pixels if color information that formed the original image before transparency was made remains in completely transparent pixels. Alternatively, it can refer to the acquired color information of each pixel to determine the frequency distribution of all pixels' colors, and if there are no colors exceeding a specific threshold in the determined frequency distribution, it can perform image processing based on the color information of all pixels.
[0046] <Third Embodiment> In the embodiments described above, a configuration was described in which the program execution server 110 executes the processes shown in Figures 3 and 5, and the results are displayed by a browser application running on the information processing device 1. However, other configurations are also possible. For example, the application that executes Figures 3 and 5 is installed on the information processing device 1, and the program code related to that application is read and executed by a processor such as the CPU 12. In this case, it goes without saying that the program code itself and the recording medium on which it is stored are also subject to the present invention. Examples of processors include CPUs, MPUs, and DSPs. In this case, since the information processing device 1 performs image processing, the information processing device 1 is called an image processing device.
[0047] Examples of recording media for recording program code include flexible disks, hard disks, optical disks, magneto-optical disks, CD-ROMs, CD-Rs, magnetic tapes, non-volatile memory cards, ROMs, and DVDs. Furthermore, the functions of the embodiments described above are not only realized by executing only the program code read by the computer. The present invention also includes cases in which the processes described in the first and second embodiments can be realized by having an "OS" or "middleware" running on the computer perform some or all of the actual processing based on the instructions of the program code.
[0048] Furthermore, program code read from a recording medium may be written to the memory of a function expansion board or function expansion unit inserted into a computer. In this case, the present invention also includes cases where a processor provided on the function expansion board or function expansion unit performs some or all of the actual processing based on the instructions of the program code, thereby realizing the functions of the first and second embodiments.
[0049] According to the first to third embodiments described above, the device acquires transparency information indicating the transparency state of each pixel of the received image (S301: first acquisition unit), and acquires color information for each pixel of the image from which the transparency information has been acquired (S304: second acquisition unit). Furthermore, if transparency information is acquired in S301, the device refers to the acquisition result in S304 and acquires the percentage of the entire image occupied by a specific color (S305: third acquisition unit). If the acquired percentage is less than a first threshold, the device performs image correction processing such as color correction (first image processing) based on the color information of pixels in the entire image (S391). Furthermore, if the acquired percentage is greater than or equal to the first threshold but less than a second threshold greater than the first threshold, the device deletes at least a portion of the color information area and performs image correction processing such as color correction (second image processing) (S308).
[0050] Furthermore, the device does not perform image processing if the acquired percentage is below both the first threshold and the second threshold (S310). As a result, when performing image correction processing based on color information of the entire image or the surrounding area of the pixels to be processed, it becomes possible to prevent image degradation such as overexposure due to transparency information.
[0051] <Variation> (1) In this embodiment, an information processing device 1 consisting of a single PC is used, but it is also possible to use a mobile terminal (smartphone, tablet, etc.) instead of this information processing device 1. To do this, for example, one can download and install a dedicated application from a specific website. This dedicated application can execute the series of processes shown in Figure 3. The monitor 2 and input device 4 correspond to the display screen of the mobile terminal, and the storage device 5 corresponds to the flash memory etc. built into the mobile terminal. (2) When multiple images are imported, thumbnails are displayed on the left side of screen 601 in Figure 6, but processed images may also be displayed as thumbnails on the right side of screen 601. Additionally, specific buttons for manually changing "Threshold 1" and "Threshold 2" can be displayed on screen 601, allowing the user to appropriately change both thresholds by operating these buttons.
[0052] <Addendum> This embodiment includes the following configuration. (Composition 1) A computer that is an image processing device capable of performing image processing on an received image, A first acquisition unit acquires transparency information indicating the transparency state of each pixel in the received image, A second acquisition unit acquires the color information of each pixel in the image from which the transparency information has been acquired, When transparency information is acquired by the first acquisition unit, the third acquisition unit acquires the percentage of the image area occupied by a specific color by referring to the acquisition result of the second acquisition unit, A program comprising: a control unit that, when the percentage acquired by the third acquisition unit is less than a first threshold, performs a first image processing based on the color information of pixels throughout the entire image; and when the percentage acquired by the third acquisition unit is greater than or equal to the first threshold but less than a second threshold greater than the first threshold, deletes at least a portion of the color information region and performs a second image processing. (Configuration 2) The program according to configuration 1, further characterized in that the control unit does not perform image processing if the percentage acquired by the third acquisition unit is equal to or greater than the first threshold and equal to or greater than the second threshold. (Composition 3) The program according to configuration 1 or configuration 2, characterized in that the first acquisition unit acquires the Alpha value of the pixels of the image. (Composition 4) The program according to configuration 1 or configuration 2, characterized in that the second acquisition unit acquires one or more values from among RGB values, grayscale values, monochrome binary values, CMYK values, and HSB values, depending on one of the calculation formulas, algorithms, and image formats used in image processing. (Composition 5) The program according to any one of configurations 1 to 3, characterized in that the third acquisition unit scans the color information of all pixels to obtain the cumulative value of pixels of a specific color, and calculates the ratio based on the obtained cumulative value and the total number of pixels. (Composition 6) The program according to any one of configurations 1 to 3, characterized in that the third acquisition unit obtains the frequency distribution of color information for all pixels and obtains the ratio from the relative frequency of a specified specific color. (Composition 7) The program according to any one of configurations 1 to 6, characterized in that when the control unit performs the second image processing, it reduces the number of completely transparent pixels to a predetermined percentage before execution. (Composition 8) The program according to any one of configurations 1 to 6, characterized in that when the control unit performs the second image processing, it does not use color information of completely transparent pixels. (Composition 9) The program according to any one of configurations 1 to 6, wherein when the control unit performs the second image processing, it extracts a rectangular region that includes all non-transparent pixels and has the minimum number of pixels in the black region, based on the image received by the receiving unit, and performs image processing. (Composition 10) The program according to any one of configurations 1 to 6, further characterized in that the control unit performs image processing based on the color information of all pixels if color information that formed the original image before transparency is retained in a completely transparent pixel. (Composition 11) The program according to any one of configurations 1 to 6, wherein the control unit further refers to the acquisition results of the second acquisition unit to determine the frequency distribution of all pixels' colors, and if there are no colors exceeding a specific threshold in the obtained frequency distribution, it performs image processing based on the color information of all pixels. (Composition 12) The program according to any one of configurations 1 to 10, further characterized in that the control unit adds transparency information acquired by the first acquisition unit to the image after performing the first image processing and the second image processing. (Composition 13) The program according to any one of configurations 1 to 11, characterized in that the first image processing and the second image processing are image correction processes including color correction processing of an image.
[0053] Although preferred embodiments of the present invention have been described above, the present invention is not limited to the embodiments described above, and various modifications and changes are possible within the scope of its gist. For example, the present invention can also be realized by supplying a program that implements one or more of the functions of the above embodiments to a system or device via a network or recording medium, and the processor of the computer in that system or device reads and executes the program. Furthermore, the present invention can also be realized by a circuit (e.g., an ASIC) that implements one or more functions. [Explanation of Symbols]
[0054] 1. Information Processing Device (Image Processing Device) 2 monitors 3. Printer 4 Input devices 5 Storage device 10 ROM 11 RAM 12 CPU 100 External Servers 110 Program Execution Server 120 storage servers
Claims
1. A computer that is an image processing device capable of performing image processing on an received image, A first acquisition means for acquiring transparency information indicating the transparency state of each pixel of the received image, A second acquisition means for acquiring color information for each pixel of the image from which the transparency information has been acquired, When transparency information is obtained by the first acquisition means, a third acquisition means obtains the percentage of the image area occupied by a specific color by referring to the acquisition result of the second acquisition means, A program characterized in that, if the percentage acquired by the third acquisition means is less than a first threshold, it performs a first image processing based on the color information of pixels throughout the entire image, and if the percentage acquired by the third acquisition means is greater than or equal to the first threshold but less than a second threshold greater than the first threshold, it functions as a control means that deletes at least a portion of the color information region and performs a second image processing.
2. The control means further, The program according to claim 1, characterized in that if the percentage acquired by the third acquisition means is equal to or greater than the first threshold and equal to or greater than the second threshold, image processing is not performed.
3. The first acquisition means is, The program according to claim 1 or 2, characterized in that it obtains the Alpha value of the pixels of the aforementioned image.
4. The second acquisition means is, The program according to claim 1 or 2, characterized in that it obtains one or more values from among RGB values, grayscale values, monochrome binary values, CMYK values, and HSB values, depending on one of the calculation formulas, algorithms, and image formats used in image processing.
5. The third acquisition means is, The program according to claim 1 or 2, characterized in that it scans the color information of all pixels to obtain the cumulative value of pixels of a specific color, and calculates the ratio based on the obtained cumulative value and the total number of pixels.
6. The third acquisition means is, The program according to claim 1 or 2, characterized in that it obtains the frequency distribution of color information for all pixels and calculates the ratio from the relative frequency of a specified specific color.
7. The control means further, The program according to claim 1 or 2, characterized in that when performing the second image processing, the number of completely transparent pixels is reduced to a predetermined percentage before performing the image processing.
8. The control means further, The program according to claim 1 or 2, characterized in that when performing the second image processing, the image processing is performed without using color information of completely transparent pixels.
9. The control means further, The program according to claim 1 or 2, characterized in that, when performing the second image processing, it extracts a rectangular region based on the received image that includes all non-transparent pixels and has the minimum number of pixels in the black region, and then performs the image processing.
10. The control means further, The program according to claim 1 or 2, characterized in that if color information that formed the original image remains in a completely transparent pixel, it performs image processing based on the color information of all pixels.
11. The control means further, The program according to claim 1 or 2, characterized in that it obtains the frequency distribution of all pixels by referring to the acquisition results of the second acquisition means, and if there are no colors in the obtained frequency distribution that exceed a specific threshold, it performs image processing based on the color information of all pixels.
12. The control means further, The program according to claim 1 or 2, characterized in that, after the first image processing and the second image processing are performed, the transparency information acquired by the first acquisition means is applied to each corresponding pixel.
13. The program according to claim 1 or 2, characterized in that the first image processing and the second image processing are image correction processing including color correction processing.
14. A control method for an image processing device capable of performing image processing on an image received, A first acquisition step involves acquiring transparency information indicating the transparency state of each pixel in the received image, A second acquisition step involves acquiring the color information of each pixel in the image from which the aforementioned transparency information has been acquired. If transparency information is obtained by the first acquisition step, a third acquisition step is performed to obtain the percentage of the image area occupied by a specific color by referring to the acquisition result of the second acquisition step, A control method characterized by comprising: a control step of performing a first image processing based on the color information of pixels in the entire image if the percentage acquired by the third acquisition step is less than a first threshold, and performing a second image processing by deleting at least a portion of the color information region if the percentage acquired by the third acquisition step is greater than or equal to the first threshold but less than a second threshold greater than the first threshold.
15. An image processing device capable of performing image processing on an received image, A first acquisition unit acquires transparency information indicating the transparency state of each pixel in the received image, A second acquisition unit acquires the color information of each pixel in the image from which the transparency information has been acquired, When transparency information is acquired by the first acquisition unit, the third acquisition unit acquires the percentage of the image area occupied by a specific color by referring to the acquisition result of the second acquisition unit, An image processing apparatus comprising: a control unit that, when the percentage acquired by the third acquisition unit is less than a first threshold, performs a first image processing based on the color information of pixels throughout the entire image; and when the percentage acquired by the third acquisition unit is greater than or equal to the first threshold but less than a second threshold greater than the first threshold, deletes at least a portion of the color information region and performs a second image processing.