A display method of a commodity, an electronic device, a program product, and a storage medium
By generating transparent main color images and product images to synthesize product thumbnails, the problem of merchants needing to create different images for different interfaces is solved, and merchants automatically generate thumbnails and improve consumer recognition and shopping experience.
Patent Information
- Application Number
- CN202210793573.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-05
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-07-05
AI Technical Summary
Merchants need to create different types of product images for different interfaces of e-commerce platforms, which leads to an increase in operational threshold, and it is difficult for consumers to identify the correlation between product thumbnails and product images under different interfaces.
By obtaining the main color of the product image, a transparent main color image is generated, and a product thumbnail is synthesized with the product image to display the main color and part of the product image, so as to automatically generate the product thumbnail.
It lowers the threshold for merchants to operate themselves and improves consumers' visual correlation and shopping experience of product thumbnails and product images under different interfaces.
Smart Images

Figure CN115063208B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of this specification relate to the field of Internet technologies, and in particular, to a method for displaying a product, an electronic device, a program product, and a storage medium. Background Art
[0002] With the booming development of e-commerce platforms, online shopping has become the mainstream choice for people when purchasing products. For products sold on e-commerce platforms, merchants need to upload product images containing detailed product information to the server of the e-commerce platform.
[0003] The product selection interface in the user version of the client usually displays multiple products for consumers to select. To improve the space utilization efficiency of the product selection interface, only product thumbnails are displayed for some products in the product selection interface. The product images are displayed in other interfaces such as the product detailed information interface. Compared with the product images, the product thumbnails do not contain too much detailed product information. Therefore, the image content displayed by the product thumbnails is different from that of the product images. Thus, since the same product is displayed with different images in different interfaces of the client, for the product selection interface, merchants also need to separately create product thumbnails. This undoubtedly increases the operation threshold for merchants. Summary of the Invention
[0004] Embodiments of this specification provide a method for displaying a product, an electronic device, a program product, and a storage medium, which can reduce the self-operation threshold for merchants.
[0005] According to a first aspect of the embodiments of this specification, a method for displaying a product is provided. The method includes:
[0006] Obtain a product image of a product;
[0007] Obtain the main color of the product image and generate a main color image; wherein, the number of pixels corresponding to the main color in the product image satisfies a preset quantity condition; the main color image includes a target area that has been subjected to transparency processing;
[0008] Generate a product thumbnail by using the main color image and the product image; wherein, the product thumbnail displays the main color and at least part of the pattern in the product image, and the target area corresponds to the at least part of the pattern;
[0009] Display the product thumbnail in the user interface of the user side.
[0010] In some examples, the generating a product thumbnail by using the main color image and the product image includes:
[0011] If the size of the product image does not match the size of the display area in the user interface, scale and / or crop the product image based on the size information of the display area, where the processed product image includes the at least partial pattern; superimpose the main color image on the upper layer of the processed product image to generate the product thumbnail; and / or
[0012] If the size of the product image does not match the size of the display area in the user interface, superimpose the main color image on the upper layer of the product image; scale and / or crop the superimposed image based on the size information of the display area, and use the processed image as the product thumbnail.
[0013] In some examples, the transparency processing includes transparency processing with a gradual change in transparency.
[0014] In some examples, the method further includes:
[0015] Obtain the text information of the product; where the text information is extracted from the product image and / or input by the merchant;
[0016] The generation process of the product thumbnail includes:
[0017] Generate the product thumbnail using the main color image, the text information, and the product image; where the product thumbnail displays the main color, the text information, and the at least partial pattern.
[0018] In some examples, obtaining the main color of the product image and generating the main color image includes:
[0019] Obtain the color value, saturation, and brightness characterizing the main color;
[0020] If the preset text gray value of the text information is greater than the first gray value threshold, reduce the saturation of the main color and / or increase the brightness of the main color to obtain the adjusted main color;
[0021] If the preset text gray value of the text information is less than the second gray value threshold, increase the saturation of the main color and / or reduce the brightness of the main color to obtain the adjusted main color; where the first gray threshold is greater than the second gray threshold;
[0022] Generate the main color image based on the adjusted main color.
[0023] In some examples, if the preset text gray value of the text information is greater than the first gray value threshold, the decrease in saturation is positively correlated with the saturation; the increase in brightness is negatively correlated with the brightness;
[0024] If the preset text gray value of the text information is less than the second gray value threshold, the increase amplitude of the saturation is negatively correlated with the saturation; the decrease amplitude of the brightness is positively correlated with the brightness.
[0025] In some examples, the method is applied to the user side, and the method further includes:
[0026] If the product thumbnail is triggered, jump to the detail interface of the product; the detail interface displays the product image.
[0027] In some examples, the product includes a privilege card; the product image includes the background image of the privilege card; the size of the background image of the privilege card in the user interface is smaller than the size of other product images in the user interface.
[0028] According to the second aspect of the embodiments of the present specification, a method for displaying a product, which is applied to the merchant side, the method includes:
[0029] Obtain the product image uploaded by the merchant;
[0030] Send the product image to the server, so that the server obtains the main color of the product image, and sends the product image and the main color to the user side, so that the user side generates a main color image; use the main color image and the product image to generate a product thumbnail; and display the product thumbnail in the user interface; wherein, the number of pixels corresponding to the main color in the product image meets the preset quantity condition; the main color image includes a target area that has been transparently processed; the product thumbnail displays at least part of the pattern in the main color and the product image, and the target area corresponds to the at least part of the pattern.
[0031] According to the third aspect of the embodiments of the present specification, a method for displaying a product, which is applied to the server side, the method includes:
[0032] Receive the product image sent by the merchant side;
[0033] Obtain the main color of the product image, and send the product image and the main color to the user side, so that the user side generates a main color image; use the main color image and the product image to generate a product thumbnail; and display the product thumbnail in the user interface; wherein, the number of pixels corresponding to the main color in the product image meets the preset quantity condition; the main color image includes a target area that has been transparently processed; the product thumbnail displays at least part of the pattern in the main color and the product image, and the target area corresponds to the at least part of the pattern.
[0034] According to a fourth aspect of the embodiments of the present specification, a method for displaying a commodity is provided, which is applied to a user terminal. The method includes:
[0035] Receiving a commodity image from a merchant terminal;
[0036] Obtaining a main color of the commodity image and generating a main color image; wherein, the number of pixels corresponding to the main color in the commodity image meets a preset quantity condition; the main color image includes a target area subjected to a transparency processing;
[0037] Generating a commodity thumbnail by using the main color image and the commodity image; wherein, the commodity thumbnail displays the main color and at least part of the patterns in the commodity image, and the target area corresponds to the at least part of the patterns;
[0038] Displaying the commodity thumbnail in a user interface.
[0039] In some examples, the generating a commodity thumbnail by using the main color image and the commodity image includes:
[0040] If the size of the commodity image does not match the size of the display area in the user interface, performing a scaling and / or cropping process on the commodity image based on the size information of the display area, wherein the processed commodity image includes the at least part of the patterns; superimposing the main color image on the upper layer of the processed commodity image to generate the commodity thumbnail; and / or
[0041] If the size of the commodity image does not match the size of the display area in the user interface, superimposing the main color image on the upper layer of the commodity image; performing a scaling and / or cropping process on the superimposed image based on the size information of the display area, and using the processed image as the commodity thumbnail.
[0042] In some examples, the transparency processing includes a transparency processing with a gradual change in transparency.
[0043] In some examples, the method further includes:
[0044] Obtaining text information of the commodity; wherein, the text information is extracted from the commodity image and / or input by the merchant;
[0045] The generating process of the commodity thumbnail includes:
[0046] Generating the commodity thumbnail by using the main color image, the text information and the commodity image; wherein, the commodity thumbnail displays the main color, the text information and the at least part of the patterns.
[0047] In some examples, obtaining the dominant color of the product image and generating a dominant color image includes:
[0048] Obtaining an adjusted dominant color obtained by reducing the saturation of the dominant color and / or increasing the brightness of the dominant color when the text gray value preset in the text information is greater than a first gray value threshold;
[0049] Or
[0050] Obtaining an adjusted dominant color obtained by increasing the saturation of the dominant color and / or reducing the brightness of the dominant color when the text gray value preset in the text information is less than a second gray value threshold; wherein, the first gray threshold is greater than the second gray threshold;
[0051] Generating the dominant color image based on the adjusted dominant color.
[0052] In some examples, if the text gray value preset in the text information is greater than the first gray value threshold, the reduction amplitude of the saturation is positively correlated with the saturation; the increase amplitude of the brightness is negatively correlated with the brightness;
[0053] If the text gray value preset in the text information is less than the second gray value threshold, the increase amplitude of the saturation is negatively correlated with the saturation; the reduction amplitude of the brightness is positively correlated with the brightness.
[0054] In some examples, the method further includes:
[0055] If the product thumbnail is triggered, jump to the detail interface of the product; the detail interface displays the product image.
[0056] In some examples, the product includes a privilege card; the product image includes the background image of the privilege card; the size of the background image of the privilege card in the user interface is smaller than the size of other product images in the user interface.
[0057] According to the fifth aspect of the embodiments of the present specification, a product display device is provided, and the device includes:
[0058] A first acquisition module, configured to: acquire a product image of a product;
[0059] A second acquisition module, configured to: acquire the dominant color of the product image and generate a dominant color image; wherein, the number of pixels corresponding to the dominant color in the product image satisfies a preset quantity condition; the dominant color image includes a target area subjected to a transparency process;
[0060] A generation module, configured to: generate a product thumbnail by using the main color image and the product image; wherein, the product thumbnail shows the main color and at least part of the patterns in the product image, and the target area corresponds to the at least part of the patterns;
[0061] A display module, configured to: display the product thumbnail in a user interface of a user terminal.
[0062] According to a sixth aspect of the embodiments of the present specification, there is provided an electronic device, which includes:
[0063] A processor;
[0064] A memory for storing processor-executable instructions;
[0065] Wherein, when the processor calls the executable instructions, the operations of any one of the above-mentioned first aspect to fourth aspect are implemented.
[0066] According to a seventh aspect of the embodiments of the present specification, there is provided a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of any one of the above-mentioned first aspect to fourth aspect are implemented.
[0067] According to an eighth aspect of the embodiments of the present specification, there is provided a computer-readable storage medium, on which a number of computer instructions are stored, and when the computer instructions are executed, the methods of any one of the above-mentioned first aspect to fourth aspect are executed.
[0068] The technical solutions provided by the embodiments of the present specification may include the following beneficial effects:
[0069] The embodiments of the present specification provide a method for displaying a product, an electronic device, a program product, and a storage medium. Based on the main color of the product image, a main color image is generated, and the main color image includes a target area that has been subjected to a transparency processing. Subsequently, a product thumbnail is generated by using the main color image and the product image. Since the product image includes at least part of the patterns, and the target area after the transparency processing corresponds to at least part of the patterns; at the same time, the other areas that have not been subjected to the transparency processing show the main color. Therefore, in the product thumbnail generated by using the main color image and the product image, at least part of the patterns of the product image and the main color of the product image can be shown. For merchants, the merchants only need to upload the product image, and through the above method, they can automatically generate and display the product thumbnail by using the uploaded product image. There is no need for merchants to re-make the product thumbnail, so the self-operation threshold of merchants is reduced.
[0070] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the embodiments of the present specification. Brief Description of the Drawings
[0071] The drawings herein are incorporated into the specification and constitute a part of the embodiments of this specification, showing the embodiments that conform to the embodiments of this specification, and are used together with the specification to explain the principles of the embodiments of this specification.
[0072] Figure 1 It is a schematic diagram of an online shopping system shown according to an embodiment of this specification.
[0073] Figure 2A It is a flowchart of a method for displaying a commodity shown according to an embodiment of this specification.
[0074] Figure 2B It is a flowchart of a method for displaying a commodity shown according to another embodiment of this specification.
[0075] Figure 3 It is a flowchart of a method for displaying a commodity shown according to another embodiment of this specification.
[0076] Figure 4 It is a flowchart of a method for displaying a commodity shown according to another embodiment of this specification.
[0077] Figure 5 It is a flowchart of a method for displaying a commodity shown according to another embodiment of this specification.
[0078] Figure 6 From A to B in [reference number] is a schematic diagram of a user interface shown according to an embodiment of this specification.
[0079] Figure 7 It is a flowchart of a method for displaying a commodity shown according to another embodiment of this specification.
[0080] Figure 8 It is a hardware structure diagram of an electronic device shown according to an embodiment of this specification. Detailed Description of the Embodiments
[0081] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all the embodiments consistent with the embodiments of this specification. On the contrary, they are merely examples of devices and methods consistent with some aspects of the embodiments of this specification as detailed in the appended claims.
[0082] The terms used in the embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit the embodiments of this specification. The singular forms "a", "the", and "said" used in the embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0083] It should be understood that although the terms first, second, third, etc. may be used in the embodiments of this specification to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of the embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".
[0084] With the booming development of e-commerce platforms, online shopping has become the mainstream choice when people purchase goods. An e-commerce platform can provide a merchant version of the client (B-side, hereinafter referred to as the merchant side) for merchants, and a user version of the client (C-side, hereinafter referred to as the user side) for consumers. As Figure 1 shown in the online shopping system 100, it includes the server 110 of the e-commerce platform, the merchant side 120, and the user side 130. Among them, the server 110 can be hosted on a server or in a server cluster composed of multiple servers. The number of the merchant side 120 and the number of the user side 130 can be multiple ( Figure 1 only one merchant side and one user side are shown as an example). The merchant side 120 and the user side 130 can be hosted in an electronic device and can run in the form of a small program or an APP (application, Application) in the electronic device. The electronic device can include, but is not limited to, a computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, or a server and other devices with data processing capabilities. In addition, communication connections can be established between the server 110, the merchant side 120, and the user side 130 pairwise to perform data interaction.
[0085] The merchant side 120 can provide merchants with a variety of marketing functions, including but not limited to product processing functions, order processing functions, customer consultation functions, payment setting functions, delivery setting functions, etc. The user side 130, on the other hand, can provide consumers with a variety of shopping functions, including but not limited to product display functions, shopping cart functions, payment functions, order management functions, etc. For the goods sold on the e-commerce platform, merchants can upload product images containing detailed product information to the server 110 of the e-commerce platform through the merchant side 120.
[0086] The client 130 includes multiple user interfaces, such as a shopping interface, a product details interface, a pop-up window interface, etc. Among them, the shopping interface usually displays multiple products for purchase. To improve the space utilization efficiency of the shopping interface, the shopping interface usually only displays product thumbnails. While the product images are displayed in other interfaces such as the product details interface. Compared with the product images, the product thumbnails do not contain excessive product detail information. Thus, since the same product is displayed with different images in different interfaces of the client, for the shopping interface, the merchant also needs to separately produce product thumbnails. This undoubtedly increases the operation threshold for the merchant.
[0087] For this reason, the embodiments of this specification provide a method for displaying a product, including the steps as Figure 2A shown:
[0088] Step 210: Obtain the product image of the product;
[0089] Step 220: Obtain the main color of the product image and generate a main color image;
[0090] Wherein, the number of pixels corresponding to the main color in the product image satisfies a preset quantity condition; the main color image includes a target area subjected to a transparency process;
[0091] Step 230: Generate a product thumbnail by using the main color image and the product image;
[0092] Wherein, the product thumbnail displays the main color and at least part of the pattern in the product image, and the target area corresponds to the at least part of the pattern;
[0093] Step 240: Display the product thumbnail in the user interface of the client.
[0094] The merchant can upload the product image of the product through the merchant side. The product image can display a pattern and at least one color. Sensually, the main color of the product image has the largest display area in the product image. For example, the main color can include but is not limited to the background color of the product image or the color displayed in a relatively large area in the product image. The product image includes multiple pixels, and each pixel has a corresponding color. Among them, one or more of the RGB color model, the CMYK color model, the HSB color model, and the Lab color model can be used to represent the color of each pixel. Thus, the color whose number of corresponding pixels in the product image satisfies the preset quantity condition can be determined as the main color of the product image. Wherein, the preset quantity condition can include but is not limited to: not less than a quantity threshold, and / or the largest quantity. That is, the number of pixels corresponding to the main color in the product image is not less than the quantity threshold and / or the largest quantity.
[0095] For example, for each color shown in the product image, the number of pixels corresponding to that color in the product image can be counted, and then based on the statistical results of all colors, the color that meets the preset quantity condition is determined as the main color of the product image.
[0096] In some embodiments, since it is difficult for the human visual sense to distinguish between two colors with small color differences. Therefore, several colors with a color distance less than a preset distance threshold can be classified as target colors. Herein, the color distance refers to the difference between two colors. The calculation method of the color distance can refer to related technologies, and the embodiments of this specification will not elaborate herein. That is, the target colors include several colors, and the color distance between these several colors is less than the preset distance threshold. Determine the sum of the number of pixels corresponding to the several colors in the product image as the number of pixels corresponding to the target colors in the product image. By merging colors, the statistical work of the number of pixels corresponding to colors can be reduced, the process of extracting the main color can be accelerated, and the generation efficiency of the product thumbnail can be improved.
[0097] After obtaining the main color of the product image, a main color image can be generated based on the main color. For example, the main color image can be a solid color image, that is, all pixels in the main color image have the same color. For another example, the colors corresponding to all pixels included in the main color image have a color distance less than the preset distance threshold from the main color of the product image.
[0098] When generating the main color image, the target area in the main color image can be made transparent. Among them, parameters such as the size, shape, and position of the target area in the main color image can be preset, or can be adjusted by the merchant themselves. In addition, in some embodiments, the transparency processing of the target area can include transparency gradient processing. That is, the transparency of the target area changes gradually according to a preset rule, thereby enhancing the aesthetic feeling of the finally generated product thumbnail. In some embodiments, the target area can be subjected to transparency gradient processing according to a preset gradient style. For example, the gradient style can include, but is not limited to, radial gradient, linear gradient, angular gradient, symmetric gradient, and diamond gradient, etc. Thus, the generated main color image includes the target area after transparency processing.
[0099] Subsequently, the main color image and the product image can be used to generate a product thumbnail. The generated product thumbnail is displayed in the user interface of the user terminal, for example, in the display area of the user interface. In this way, the problem of size matching between the product thumbnail and the display area can be considered. In some embodiments, if the size of the product thumbnail uploaded by the user matches the size of the display area, a main color image with the same size as the display area can be generated, and then the main color image is superimposed on the upper layer of the product image. The superimposing process may include: determining the main color image as the first layer; determining the product image as the second layer, and superimposing the first layer on the second layer to generate a product thumbnail showing at least part of the pattern in the main color and the product image.
[0100] In some embodiments, if the size of the product thumbnail uploaded by the user does not match the size of the display area, based on the size information of the display area, the product image can be first scaled and / or cropped so that the size of the processed product image matches the size of the display area, and the processed product image includes at least part of the pattern. Among them, the cropping process may include cropping according to a preset cropping strategy. The cropping strategy may include any one or more of the following: starting to crop from a specified position of the product image, cropping out an image without text information, and cropping out an image containing complete text information. And a main color image with the same size as the display area is generated. Among them, the generation step of the main color image and the processing step of the product image do not have a sequential execution order and can also be executed simultaneously. Subsequently, the main color image can be superimposed on the upper layer of the product image. The superimposing process may include: determining the main color image as the first layer; determining the processed product image as the second layer, and superimposing the first layer on the second layer to generate a product thumbnail showing at least part of the pattern in the main color and the product image.
[0101] In some other embodiments, if the size of the product thumbnail uploaded by the user does not match the size of the display area, the main color image can be first superimposed on the upper layer of the product image. Among them, the size of the main color image may or may not match the size of the display area. The superimposing process may include: determining the main color image as the first layer; determining the product image as the second layer, and superimposing the first layer on the second layer to obtain a superimposed image. Subsequently, based on the size information of the display area, the superimposed image is scaled and / or cropped, and the processed image is used as the product thumbnail.
[0102] The generated product thumbnail shows the main color and at least part of the pattern in the product image, and the target area in the main color image corresponds to the at least part of the pattern. The fact that the target area corresponds to at least part of the pattern may mean that the target area corresponds to at least part of the pattern in terms of position. As an example, during the superposition process in any of the above embodiments, the relative positional relationship between the main color image and the product image can be adjusted so that the target area corresponds to at least part of the pattern in terms of position. Since the target area is made transparent, when the main color image is superimposed on the upper layer of the product image and the target area corresponds to at least part of the pattern in terms of position, the at least part of the pattern can be shown through the target area. Other areas that are not made transparent cover other image contents in the product image except for the at least part of the pattern, showing the main color of the product image. Therefore, the generated product thumbnail shows both the main color of the product image and at least part of the pattern of the product image.
[0103] The generated product thumbnail can be shown in the user interface of the user side or in the user interface of the merchant side. For example, the product thumbnail can be shown in the user interface of the merchant side for the merchant to preview and confirm the generated product thumbnail. Also for example, the product thumbnail can be shown in the shopping interface of the user side for consumers to select products.
[0104] In some embodiments, if the user interface is the user interface of the user side, for example, the user interface can be the above-mentioned shopping interface. Then, the user interface can include several product controls, and the display area in the user interface can correspond to the product controls. The product controls are used to implement the jump to the lower-level interface, such as the detailed interface of the product. Thus, if it is detected that the product area is triggered, it will jump to the detailed interface of the product. Among them, the detailed interface can show the product image of this product.
[0105] A product display method provided by the embodiments of this specification. Merchants only need to upload product images, and through the above method, they can automatically generate and display product thumbnails using the uploaded product images. There is no need for merchants to remake product thumbnails, so the self-operation threshold of merchants is reduced.
[0106] In addition, since different user interfaces display different images of a product. For example, product thumbnails are usually displayed on the shopping interface, while product images are usually displayed on the product details interface, or after a consumer purchases the product, they are displayed on the consumer's personal assets interface. At the same time, the image content shown in the product thumbnail and the product image is not the same. Therefore, in some scenarios, if the visual difference between the product thumbnail and the product image is significant, when a consumer views the product thumbnail and the product image of a certain product on different interfaces, they will not be able to intuitively recognize that the product thumbnail and the product image belong to the same product. Thus, consumers may need to use other means such as text to recognize that the product thumbnail and the product image belong to the same product. Obviously, such a recognition method is less intuitive and affects the shopping experience of consumers, especially those with reading difficulties such as the elderly.
[0107] Generally speaking, people recognize images through features such as the color of the image and the patterns and textures it displays. The product thumbnail generated in the embodiments of this specification displays the main color of the product image and at least some of the patterns in the product image. Therefore, the main color of the product image and at least some of the patterns are used to visually associate the product thumbnail with the product image. So that when a consumer sees the product image and the product thumbnail of a certain product on different interfaces respectively, they can also intuitively associate these two images, improving the sales atmosphere and the shopping experience of consumers at the same time.
[0108] Regarding the execution subject of a product display method provided in the embodiments of this specification, in some embodiments, the product display method in any of the above embodiments can be executed by the merchant side. For example, the merchant side can be such as Figure 1The merchant terminal 120 shown. In this way, the acquisition process of the product image in the above step 210 may include: acquiring the product image uploaded by the merchant on the merchant terminal 120. The merchant terminal 120 can obtain the main color of the product image through a preset color picking tool, including but not limited to an intelligent color picking tool or other online color picking tools. Then, based on the extracted main color, a main color image including a target area that has been transparently processed is generated. Among them, when the merchant terminal 120 runs in the form of a small program, CSS (Cascading Style Sheets) computer language, such as CSS3 language, can be used to achieve transparency processing of the target area. When the merchant terminal 120 runs in the form of an APP, a transparency tool can be used to achieve transparency processing of the target area. Among them, the transparency tool is a tool that comes with the operating system of the electronic device equipped with the user terminal 130. Subsequently, the merchant terminal 120 can use the main color image and the product image to generate a product thumbnail. The display process of the product thumbnail in the above step 240 may include: sending the product thumbnail to the user terminal so that the user terminal displays the product thumbnail in the display area of its user interface. As Figure 1 As shown, the merchant terminal 120 can directly send the product thumbnail to the user terminal 130 through the communication connection between the merchant terminal 120 and the user terminal 130. The merchant terminal 120 can also upload the product thumbnail to the server 110 and distribute the product thumbnail to at least one user terminal 130 through the server 110.
[0109] Furthermore, before sending the product thumbnail to the user terminal 130, the generated product thumbnail can be displayed to the merchant in the display area of the user interface of the merchant terminal 120, so that the merchant can confirm whether to use the product thumbnail. In some examples, if the merchant is not satisfied with the main color displayed in the product thumbnail, the merchant can manually reselect or adjust the main color; and / or if the merchant is not satisfied with at least a portion of the pattern displayed in the product thumbnail, the merchant can manually reselect or adjust at least a portion of the displayed pattern. The method of manually reselecting or adjusting at least a portion of the displayed pattern includes: adjusting one or more of the size, shape, or position of the target area in the main color image, or adjusting the relative superimposition position of the main color image when superimposing the main color image on the upper layer of the product image.
[0110] In some embodiments, a method for displaying a commodity in any of the above embodiments may be executed by a user terminal. For example, the user terminal may be as follows: Figure 1The user terminal 130 shown in FIG. Thus, the process of acquiring the product image in step 210 may include: receiving the product image sent by the service terminal 110 or the merchant terminal 120. The user terminal 130 may extract the primary color from the received product image and generate a primary color image. The primary color image includes a target area that has been rendered transparent. During the process of generating the primary color image, the user terminal 130 may generate a primary color image with dimensions that match the dimensions of the display area based on the size information of the display area in the user interface of the user terminal 130. The size information of the display area may be pre-stored in the electronic device equipped with the user terminal 130. Furthermore, the user terminal 130 may adjust one or more of the shape, size, and position of the target area in the primary color image based on the size information of the display area. Furthermore, when the user terminal 130 is running as a mini-program, the target area may be rendered transparent using a CSS (Cascading Style Sheets) computer language, such as CSS3. When the user terminal 130 is running as an app, the target area may be rendered transparent using a transparency tool. Among them, the transparency tool is a tool that comes with the operating system of the electronic device equipped with the user terminal 130. The transparency processing can include transparency processing with gradual transparency, so as to enhance the aesthetics of the final generated product thumbnail. On the one hand, since the computing resources required for the transparency processing of the target area are relatively small, the transparency processing of the target area by the user terminal saves the computing resources of the server and does not bring too much computing burden to the user terminal. On the other hand, the target area is adjusted according to the size of the display area of different user terminals, so the user terminal has better adaptability to the transparency processing of the target area. Subsequently, the user terminal 130 can use the main color image and the product image to generate a product thumbnail, and display the product thumbnail in the display area of its user interface.
[0111] In some embodiments, a method for displaying a commodity in any of the above embodiments may be executed by a server. For example, the server may be Figure 1The server 110 as shown. Thus, the process of obtaining the product image in step 210 above may include: receiving the product image sent by the merchant terminal 120. The server 110 may extract the main color from the received product image. Then, based on the extracted main color, a main color image is generated, and the main color image includes a target area that has been transparently processed. Subsequently, the server 110 may generate a product thumbnail using the main color image and the product image. The process of displaying the product thumbnail in step 240 above may include: sending the product thumbnail to the user terminal so that the user terminal displays the product thumbnail in the display area of its user interface. In some examples, before sending the product thumbnail to the user terminal 130, the product thumbnail may also be sent to the merchant terminal 120 first for the merchant to confirm whether to use the product thumbnail. If the merchant is not satisfied with the automatically generated product thumbnail, adjustments can be made. For the specific adjustment method, refer to the above, and the embodiments of this specification will not be elaborated here.
[0112] In some other embodiments, the display method of a product in any of the above embodiments may be jointly executed by the merchant terminal, the server, and the user terminal. For example, the server may be the server 110 as Figure 1 described; the merchant terminal may be the merchant terminal 120 as Figure 1 shown; the user terminal may be the user terminal 130 as Figure 1 shown. Thus, a display method of a product provided in this embodiment includes the steps as Figure 2B shown:
[0113] Step 211: The merchant terminal obtains the product image uploaded by the merchant;
[0114] Step 212: The merchant terminal sends the product image to the server;
[0115] Step 221: The server extracts the main color of the product image;
[0116] Step 222: The server sends the product image and the main color to the user terminal;
[0117] Step 223: The user terminal generates a main color image based on the main color;
[0118] wherein, the main color image includes a target area that has been transparently processed;
[0119] Step 231: Generate a product thumbnail using the main color image and the product image;
[0120] Step 241: Display the product thumbnail in the user interface.
[0121] Among them, the implementation manners of the above steps 211 - step 241 refer to the embodiments described above, and the embodiments of this specification will not be elaborated here.
[0122] In this embodiment, a method for displaying a product is jointly executed by a merchant terminal, a server, and a user terminal. The step of extracting the main color (step 221) is executed by the server, making full use of the server's powerful computing capabilities. At the same time, matching the sizes of the display screens of different electronic devices, the display areas of the user terminals installed on different electronic devices also have different size information. And the electronic device installed with the user terminal stores the size information of the display area. In order to generate a product thumbnail according to the size information of the display area, the step of generating the main color image (step 223) and the step of generating the product thumbnail (step 231) are executed by the user terminal. Thus, in this embodiment, on the one hand, it is possible to generate corresponding product thumbnails adapted to different sizes of the display area, and on the other hand, it is also possible to balance the computing loads of the electronic devices where the server and the user terminal are located, making full use of the computing capabilities of the electronic devices, so as to efficiently generate product thumbnails.
[0123] In order to enable the product thumbnail to provide consumers with more product information, in some embodiments, the product thumbnail can also display the text information of the product. Thus, a method for displaying a product provided in this embodiment includes the steps as Figure 3 shown:
[0124] Step 310: Obtain the text information of the product;
[0125] Wherein, the text information is extracted from the product image and / or input by the merchant;
[0126] Step 320: Obtain the product image of the product;
[0127] Step 330: Obtain the main color of the product image and generate a main color image;
[0128] Wherein, the main color image includes a target area that has been transparently processed;
[0129] Step 340: Use the main color image, the text information, and the product image to generate the product thumbnail;
[0130] Wherein, the product thumbnail displays the main color, the text information, and at least part of the pattern;
[0131] Step 350: Display the product thumbnail on the user interface.
[0132] Among them, the above steps 320-350 can refer to the descriptions of the above steps 210-240, and the embodiments of this specification will not repeat them here. There is no sequential execution order between step 310 and steps 320-330, and they can be executed simultaneously. The product image uploaded by the merchant may carry text information describing the product. Thus, the text information carried can be extracted from the product image using optical character recognition technology. The text information of the product can be displayed in the product thumbnail in a preset color, font size, font, and position. As an example, the generation process of the product thumbnail may include: superimposing the text corresponding to the text information, the main color image, and the product image from top to bottom in sequence, so that the text corresponding to the text information is displayed on the top layer of the product thumbnail; the main color image is displayed on the second layer of the product thumbnail; and the product image is displayed on the bottom layer of the product thumbnail. Thus, the product thumbnail can also provide consumers with more product information, so as to improve the space utilization efficiency of the user interface and the shopping experience of consumers.
[0133] Since the product thumbnail simultaneously displays the main color, at least some patterns, and text information of the product image, the image content displayed in the product thumbnail is relatively large. It can be understood that the other image content (main color and at least some patterns) displayed in the product thumbnail except for the text serves as the background of the text, which will affect the readability of the text. To improve the readability of the text in the product thumbnail, the background of the text can be adjusted. In some embodiments, the generation process of the main color image in the above step 330 may include the steps as Figure 4 shown:
[0134] Step 331: Obtain the color value, saturation, and brightness characterizing the main color;
[0135] Step 332: If the preset text gray value of the text information is greater than the first gray value threshold, reduce the saturation of the main color and / or increase the brightness of the main color to obtain the adjusted main color;
[0136] Step 333: If the preset text gray value of the text information is less than the second gray value threshold, increase the saturation of the main color and / or reduce the brightness of the main color to obtain the adjusted main color;
[0137] Among them, the first gray threshold is greater than the second gray threshold;
[0138] Step 334: Generate the main color image based on the adjusted main color.
[0139] Among them, in step 331, since there can be multiple different color models to represent the same color, such as the RGB color model, CMYK color model, HSB color model, and Lab color model described above. Therefore, if the main color obtained from the product image is represented in the HSB color model, the color value (Hue), saturation, and brightness of the main color can be directly obtained. If the main color obtained from the product image is represented in other color models, such as the RGB color model, then the color model can be first converted to the HBS color model, and then the color value, saturation, and brightness of the main color can be obtained. Among them, the conversion method between color models can refer to the related technology, and the embodiments of this specification will not elaborate here.
[0140] Among them, the color value affects the texture appearance of the color, that is, colors such as red, green, and blue in visual perception. The value range of the color value is 0 - 360. Saturation affects the vividness of the color and depends on the content of white in the color. The value range of saturation is 0 - 100. The higher the saturation value, the deeper the color perception. Brightness affects the light and dark degree of the color and depends on the content of black in the color. The value range of brightness is 0 - 100. The smaller the brightness value, the deeper the color perception.
[0141] Text can be displayed in the product thumbnail with a certain gray value, where the text gray value can be preset. When the text gray value is larger, the text is closer to black; when the text gray value is smaller, the text is closer to white. Thus, the adjustment strategy of the main color can be determined by comparing the preset text gray value with the first gray value threshold and the second gray value threshold, where the first gray value threshold is greater than the second gray value threshold. Those skilled in the art can determine the first gray value threshold and the second gray value threshold according to actual needs.
[0142] When the preset text gray value is greater than the first gray value threshold, the text color is darker and closer to black. Thus, the saturation of the main color can be reduced, and / or the brightness of the main color can be increased. Based on the initial color value, the adjusted saturation, and the adjusted brightness, the adjusted main color is obtained. The adjusted main color becomes lighter in color perception, increasing the contrast with the text, thereby improving the readability of the text in the product thumbnail.
[0143] When the preset text gray value is less than the second gray value threshold, the text color is lighter and closer to white. Thus, the saturation of the main color can be increased, and / or the brightness of the main color can be reduced. Based on the initial color value, the adjusted saturation, and the adjusted brightness, the adjusted main color is obtained. The adjusted main color becomes darker in color perception, increasing the contrast with the text, thereby improving the readability of the text in the product thumbnail.
[0144] The adjusted main color is represented in the HBS color mode. In some embodiments, the HBS color mode can be converted to other color modes.
[0145] In addition, the embodiments of this specification also propose that for different values of saturation, there are corresponding different adjustment amplitudes, and / or for different values of brightness, there are corresponding different adjustment amplitudes. When the preset text gray value is greater than the first gray value threshold, the saturation of the main color can be reduced, and / or the brightness of the main color can be increased. As an example, the decrease in saturation is positively correlated with saturation, that is, the higher the initial saturation of the main color, the greater its decrease, and the lower the adjusted saturation. As an example, the increase in brightness is negatively correlated with brightness, that is, the lower the initial brightness of the main color, the greater its increase, and the higher the adjusted brightness. It can be understood that when the text gray value is large, the saturation of the main color is high, and the brightness is low, both the text and the main color are relatively deep in color perception. Through the above adjustments, the originally deeper main color can become lighter more significantly in color perception, while the originally lighter main color becomes lighter less significantly in color perception. That is, the more similar the main color is to the text in color perception, the greater the adjustment amplitude of the main color.
[0146] When the preset text gray value is less than the second gray value threshold, the saturation of the main color can be increased, and / or the brightness of the main color can be reduced. As an example, the increase in saturation is negatively correlated with saturation, that is, the lower the initial saturation of the main color, the greater its increase, and the higher the adjusted saturation. As an example, the decrease in brightness is positively correlated with brightness, that is, the higher the initial brightness of the main color, the greater its decrease, and the lower the adjusted brightness. It can be understood that when the text gray value is small, the saturation of the main color is low, and the brightness is high, both the text and the main color are relatively light in color perception. Through the above adjustments, the originally lighter main color can become darker more significantly in color perception, while the originally darker main color becomes darker less significantly in color perception. That is, the more similar the main color is to the text in color perception, the greater the adjustment amplitude of the main color.
[0147] As an example, when the text gray value is less than the second gray threshold, the color of the text displayed in the product thumbnail is closer to white, then the saturation is adjusted according to the first formula. The first formula is:
[0148] Ys = Xs + Addmax – Xs * Addmax / 100
[0149] Where Ys is the adjusted saturation, Xs is the initial saturation, Addmax – Xs * Addmax / 100 is the increase in saturation, and Addmax is the maximum value of the increase in saturation. It can be seen that the increase in saturation is negatively correlated with the initial saturation Xs. Those skilled in the art can determine the value of Addmax according to actual needs. For example, 20. Thus, the above first formula can be expressed as:
[0150] Ys = 4*Xs / 5 + 20
[0151] When the initial saturation (Xs) is 0, the adjusted saturation (Ys) is 20, and the increase is 20; when the initial saturation (Xs) is 100, the adjusted saturation (Ys) is still 100, and the increase is 0. It can be seen that the lower the initial saturation, the more obvious the deepening of the adjusted saturation in terms of color perception.
[0152] In addition, the brightness can be adjusted according to the second formula, and the second formula is:
[0153] Yb = Xb – Xb*Submax / 100
[0154] Among them, Yb is the adjusted brightness, Xb is the initial brightness, Xb*Submax / 100 is the reduction in brightness, and Submax is the maximum value of the reduction in brightness. It can be known that the reduction in brightness is positively correlated with the initial brightness Xb. Those skilled in the art can determine the value of Submax according to actual needs. For example, if Submax is 10, then the above first formula can be expressed as:
[0155] Yb = 9*Xb / 10
[0156] When the initial brightness (Xb) is 0, the adjusted brightness (Yb) is still 0, and the reduction is 0; when the initial brightness (Xb) is 100, the adjusted saturation (Yb) is still 90, and the reduction is 10. It can be seen that the higher the initial brightness, the more obvious the deepening of the adjusted brightness in terms of color perception.
[0157] By adjusting the main color through the above embodiments, the main color can be adjusted accordingly according to the text gray value and the similarity between the main color and the text in terms of color perception, so as to increase the contrast between the text and the main color and improve the readability of the text.
[0158] In some embodiments, the above steps 331 - 334 can be executed by the server side. Thus, a method for displaying a commodity provided by the embodiments of this specification may include the steps as Figure 5 shown:
[0159] Step 511: The merchant side obtains the commodity image uploaded by the merchant;
[0160] Step 512: The merchant side sends the commodity image to the server side;
[0161] Step 520: The server side obtains the main color of the commodity image and adjusts the main color according to the text gray value;
[0162] Step 530: The server side sends the commodity image and the adjusted main color to the user side;
[0163] Step 540: The client generates a main color image based on the adjusted main color and the size information of the display area;
[0164] The main color image includes a target area that has been transparently processed;
[0165] Step 550: The client generates a product thumbnail using the main color image and the product image;
[0166] Step 560: The product thumbnail is displayed in the display area of the user interface.
[0167] Among them, the implementation manners of the above steps 510 - 560 refer to the embodiments described above, and the embodiments of this specification will not be elaborated here.
[0168] In this embodiment, the product thumbnail is generated collaboratively by the server and the client. The adjustment step of the main color (step 520) is executed by the server, making full use of the powerful computing power of the server. At the same time, matching the sizes of the display screens of different electronic devices, the display areas of the clients installed on different electronic devices also have different size information. And the electronic device installed with the client stores the size information of the display area. In order to generate a product thumbnail according to the size information of the display area, the generation step of the main color image (step 540) and the generation step of the product thumbnail (step 550) are executed by the client. By generating the product thumbnail collaboratively by the server and the client, on the one hand, it can generate corresponding product thumbnails adapted to different sizes of the display area, and on the other hand, it can also balance the computing loads of the electronic devices where the server and the client are located, making full use of the computing power of the electronic devices, so as to efficiently generate product thumbnails.
[0169] In some embodiments, the above product may include a rights and interests card, where the rights and interests card is used to provide product rights and interests to the holder of the rights and interests card. The product rights and interests may include but are not limited to enjoying product price discounts, having the purchase right of specified products, having the use right of virtual resources, etc. The product rights and interests provided by the rights and interests card to the holder may have restrictions on the number of times and / or time, or may have no restrictions on the number of times and / or time.
[0170] For example, the rights and interests card may include a membership card. After a consumer purchases the membership card and becomes a member, they can enjoy one or more of the following rights and interests: purchasing at least some products at the member price, purchasing member-only products designated by the merchant that can only be purchased by members, and the purchase limit of a specified product for members being greater than or less than that of non-members for the same product.
[0171] For another example, if the merchant provides virtual resource usage services, such as music resources, then after a consumer purchases the membership card and becomes a member, they can have the use right of the member virtual resources designated by the merchant, such as the playback and download rights of the member music library.
[0172] For another example, if the commodity rights and interests provided to the holder are limited in number, the rights and interests card may include a punch card. The holder of the punch card can enjoy the commodity rights and interests specified by the punch card for a specified number of times within a limited or unlimited time. If the commodity rights and interests provided to the holder are time-limited, the rights and interests card may include a monthly card. The holder of the monthly card can enjoy the commodity rights and interests for a limited or unlimited number of times within the time specified by the monthly card.
[0173] Different from other commodities sold by merchants, generally speaking, the rights and interests card is not sold separately, but is sold together with other commodities sold. Or rather, consumers often add the rights and interests card to their purchase when buying commodities because they hope to enjoy the commodity rights and interests. In the online shopping scenario, the rights and interests card is often a virtual card. For consumers, when considering whether to add the rights and interests card to their purchase, they focus more on the rights and interests provided by the rights and interests card rather than the commodity image of the rights and interests card, that is, the background image of the rights and interests card. Therefore, as Figure 6 shown in the purchase interface of FIG. A, the size of the corresponding display area of the rights and interests card (the "monthly card" shown in the figure) in the purchase interface is smaller than the size of the corresponding display areas of other commodities. At the same time, in the display area corresponding to the rights and interests card, the rights and interests provided by the rights and interests card are displayed in text form to attract consumers to purchase.
[0174] It can be seen that on the one hand, since the display area corresponding to the rights and interests card is small, the background image of the rights and interests card cannot be fully displayed in the purchase interface. On the other hand, since the background image is not a factor that consumers consider when adding the rights and interests card to their purchase, it is not necessary to fully display the background image of the rights and interests card in the purchase interface. Therefore, in the purchase interface, only a thumbnail of the rights and interests card is often displayed.
[0175] The details interface of the rights and interests card can display the complete background image of the rights and interests card. Among them, the details interface can include a personal assets interface. After adding the rights and interests card of a certain merchant, the consumer can view the held rights and interests card in the personal assets interface as shown in Figure 6 FIG. B. Since different images are used in the purchase interface and the personal assets interface to display the same rights and interests card, when the user purchases the rights and interests card, how to intuitively judge the purchased rights and interests card among all the rights and interests cards displayed in the personal assets interface will affect the shopping experience of consumers.
[0176] Therefore, an embodiment of this specification proposes a method for displaying a commodity, as Figure 7As shown, the background image 710 of the membership card can be cropped from the top to obtain an image 720 that matches the size of the display area. At the same time, the background image 710 can be intelligently color-picked to obtain the main color of the background image 710, and a main color image 730 can be generated based on the main color. Among them, when generating the main color image 730, a radial gradient transparency process is performed on the target area, and the main color can be adjusted according to the embodiments described above to increase the contrast with the text. At the same time, the merchant can also upload the membership card sales text information. In this way, the sales text information can be used to generate a text image 740 according to a preset text layout. Finally, using the cropped image 720, the main color image 730, and the text image 740, a thumbnail 750 of the membership card is generated and displayed in the display area of the user interface.
[0177] Compared with the background image 710 of the membership card, the thumbnail 750 of the membership card generated by the above method includes the main color of the background image 710 and at least part of the pattern. Therefore, the main color of the background image 710 and at least part of the pattern are used to visually associate the thumbnail 750 with the background image 710. When consumers see the background image 710 and the thumbnail 750 of the same membership card on different interfaces respectively, they can also intuitively associate these two images with each other. Then, among all the membership cards displayed on the personal asset interface, it is also possible to intuitively determine the purchased membership card, improving the sales atmosphere and the shopping experience of consumers at the same time.
[0178] In addition, the embodiments of this specification also provide a method for displaying a commodity, which is applied to the merchant side. The method includes:
[0179] Obtain the commodity image uploaded by the merchant;
[0180] Send the commodity image to the server so that the server obtains the main color of the commodity image and sends the commodity image and the main color to the user side so that the user side generates a main color image; use the main color image and the commodity image to generate a commodity thumbnail; and display the commodity thumbnail in the user interface; where the number of pixels corresponding to the main color in the commodity image meets a preset quantity condition; the main color image includes a target area that has been transparently processed; the commodity thumbnail displays the main color and at least part of the pattern in the commodity image, and the target area corresponds to the at least part of the pattern.
[0181] Among them, the implementation manners of the above steps refer to the embodiments described above, and the embodiments of this specification will not be elaborated here.
[0182] In addition, the embodiments of the present specification also provide a method for displaying a commodity, which is applied to a server, and the method includes:
[0183] Receiving a commodity image sent by a merchant terminal;
[0184] Obtaining the main color of the commodity image, and sending the commodity image and the main color to a user terminal so that the user terminal generates a main color image; generating a commodity thumbnail by using the main color image and the commodity image; and displaying the commodity thumbnail in a user interface; wherein, the number of pixels corresponding to the main color in the commodity image meets a preset quantity condition; the main color image includes a target area that has been subjected to a transparency processing; the commodity thumbnail displays at least part of the pattern in the main color and the commodity image, and the target area corresponds to the at least part of the pattern.
[0185] Wherein, the implementation manners of the above steps refer to the embodiments described above, and the embodiments of the present specification will not elaborate herein.
[0186] In addition, the embodiments of the present specification also provide a method for displaying a commodity, which is applied to a user terminal, and the method includes:
[0187] Receiving a commodity image sent by a merchant terminal;
[0188] Obtaining the main color of the commodity image and generating a main color image; wherein, the number of pixels corresponding to the main color in the commodity image meets a preset quantity condition; the main color image includes a target area that has been subjected to a transparency processing;
[0189] Generating a commodity thumbnail by using the main color image and the commodity image; wherein, the commodity thumbnail displays at least part of the pattern in the main color and the commodity image, and the target area corresponds to the at least part of the pattern;
[0190] Displaying the commodity thumbnail in a user interface.
[0191] In some examples, the generating a commodity thumbnail by using the main color image and the commodity image includes:
[0192] If the size of the commodity image does not match the size of the display area in the user interface, performing a scaling and / or cropping process on the commodity image based on the size information of the display area, wherein the processed commodity image includes the at least part of the pattern; superimposing the main color image on the upper layer of the processed commodity image to generate the commodity thumbnail; and / or
[0193] If the size of the product image does not match the size of the display area in the user interface, overlay the main color image on top of the product image; based on the size information of the display area, perform scaling and / or cropping on the overlaid image, and use the processed image as the product thumbnail.
[0194] In some examples, the transparency processing includes transparency processing with a gradual change in transparency.
[0195] In some examples, the method further includes:
[0196] Obtain the text information of the product; wherein, the text information is extracted from the product image and / or input by the merchant;
[0197] The generation process of the product thumbnail includes:
[0198] Generate the product thumbnail using the main color image, the text information, and the product image; wherein, the product thumbnail displays the main color, the text information, and at least part of the pattern.
[0199] In some examples, obtaining the main color of the product image and generating the main color image includes:
[0200] Obtain the adjusted main color obtained by reducing the saturation of the main color and / or increasing the brightness of the main color when the text gray value preset in the text information is greater than the first gray value threshold;
[0201] Or
[0202] Obtain the adjusted main color obtained by increasing the saturation of the main color and / or reducing the brightness of the main color when the text gray value preset in the text information is less than the second gray value threshold; wherein, the first gray threshold is greater than the second gray threshold;
[0203] Generate the main color image based on the adjusted main color.
[0204] In some examples, if the text gray value preset in the text information is greater than the first gray value threshold, the decrease in saturation is positively correlated with the saturation; the increase in brightness is negatively correlated with the brightness;
[0205] If the text gray value preset in the text information is less than the second gray value threshold, the increase in saturation is negatively correlated with the saturation; the decrease in brightness is positively correlated with the brightness.
[0206] In some examples, if the product thumbnail is triggered, jump to the detail interface of the product; the detail interface displays the product image.
[0207] In some examples, the commodity includes a privilege card; the commodity image includes a background image of the privilege card; the size of the background image of the privilege card in the user interface is smaller than the size of other commodity images in the user interface.
[0208] Based on the method for displaying a commodity described in any of the above embodiments, an embodiment of this specification further provides a commodity display device, and the device includes:
[0209] A first acquisition module, configured to: acquire a commodity image of a commodity;
[0210] A second acquisition module, configured to: acquire a main color of the commodity image and generate a main color image; wherein, the number of pixels corresponding to the main color in the commodity image meets a preset quantity condition; the main color image includes a target area that has been subjected to a transparency process;
[0211] A generation module, configured to: generate a commodity thumbnail by using the main color image and the commodity image; wherein, the commodity thumbnail displays the main color and at least part of the pattern in the commodity image, and the target area corresponds to the at least part of the pattern;
[0212] A display module, configured to: display the commodity thumbnail in a user interface of a user terminal.
[0213] Based on the method for displaying a commodity described in any of the above embodiments, an embodiment of this specification further provides a Figure 8 structural schematic diagram of an electronic device as shown in Figure 8 , at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory. Of course, it may also include other hardware required for other services. The processor reads a corresponding computer program from the non-volatile memory into the memory and then runs it to implement the method for displaying a commodity described in any of the above embodiments.
[0214] Based on the method for displaying a commodity described in any of the above embodiments, an embodiment of this specification further provides a computer program product, including a computer program, and when the computer program is executed by a processor, it can be used to execute the method for displaying a commodity described in any of the above embodiments.
[0215] Based on the method for displaying a commodity described in any of the above embodiments, an embodiment of this specification further provides a computer storage medium, and the storage medium stores a computer program, and when the computer program is executed by a processor, it can be used to execute the method for displaying a commodity described in any of the above embodiments.
[0216] The foregoing describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order shown or sequential order to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0217] Those skilled in the art will readily conceive of other implementations of the embodiments of the present specification after considering the specification and practicing the invention herein. The embodiments of the present specification are intended to cover any variations, uses, or adaptations of the embodiments of the present specification, which follow the general principles of the embodiments of the present specification and include well-known knowledge or conventional technical means in the technical field not claimed in the embodiments of the present specification. The specification and embodiments are only to be considered exemplary, and the true scope and spirit of the embodiments of the present specification are pointed out by the following claims.
Claims
1. A method for displaying a commodity, the method comprising: Obtaining a commodity image of a target commodity; the commodity image is used to be displayed in a commodity details interface of the target commodity on a user side running on a mobile terminal; The target commodity includes a privilege card; Cropping a partial pattern from the commodity image and extracting text information in the commodity image that characterizes the privileges provided by the privilege card; Obtaining an initial main color of the commodity image, wherein the number of pixels corresponding to the initial main color in the commodity image meets a preset quantity condition; Adjusting the obtained initial main color according to a preset text gray value of the text information to obtain an adjusted main color; wherein, if the text gray value is greater than a first gray value threshold, based on a positive correlation between the initial saturation of the initial main color and a saturation reduction amplitude, reducing the initial saturation of the initial main color, and based on a negative correlation between the initial brightness of the initial main color and a brightness increase amplitude, increasing the initial brightness of the initial main color; if the text gray value is less than a second gray value threshold, based on a negative correlation between the initial saturation and a saturation increase amplitude, increasing the initial saturation of the initial main color, and based on a positive correlation between the initial brightness and a brightness reduction amplitude, reducing the initial brightness of the initial main color; the first gray value threshold is greater than the second gray value threshold; Generating a main color image according to the adjusted main color; the main color image includes a target area that has been subjected to transparency processing; Generating a commodity thumbnail by using the main color image and the commodity image; wherein, the commodity thumbnail displays the text information, the adjusted main color and the partial pattern, the main color image is located on the upper layer of the processed commodity image, and the target area corresponds to the partial pattern in position, and the partial pattern can be displayed through the target area; Displaying the commodity thumbnail in a purchase interface on the user side for displaying multiple commodities; wherein, the size of the commodity thumbnail displayed in the purchase interface is smaller than the size of the commodity image displayed in the commodity details interface.
2. The method according to claim 1, wherein generating the commodity thumbnail includes: If the size of the commodity image does not match the size of the display area in the purchase interface, performing scaling and / or cropping processing on the commodity image based on the size information of the display area, wherein the processed commodity image includes the partial pattern; superimposing the main color image on the upper layer of the processed commodity image to generate the commodity thumbnail; and / or If the size of the commodity image does not match the size of the display area in the purchase interface, superimposing the main color image on the upper layer of the commodity image; performing scaling and / or cropping processing on the superimposed image based on the size information of the display area, and using the processed image as the commodity thumbnail.
3. The method according to claim 1, wherein the transparency processing includes transparency processing with a gradual change in transparency.
4. The method according to claim 1, wherein the method is applied to a user side, and the method further includes: If the product thumbnail is triggered, jump to the product details interface.
5. The method according to claim 1, wherein the product image includes the background image of the benefit card; the size of the background image of the benefit card in the purchase interface is smaller than the size of other product images in the purchase interface.
6. A method for displaying a product, which is applied to a merchant terminal, and the method includes: Obtain the product image of the target product uploaded by the merchant. The product image is used to be displayed in the product details interface of the target product on the user terminal running on the mobile terminal; the target product includes a benefit card. Send the product image to the server so that the server executes the following process: Intercept a part of the pattern from the product image and extract the text information representing the benefits provided by the benefit card in the product image. Obtain the initial main color of the product image, wherein the number of pixels corresponding to the initial main color in the product image meets a preset quantity condition. According to the preset text gray value of the text information, adjust the obtained initial main color to obtain the adjusted main color; wherein, if the text gray value is greater than the first gray value threshold, based on the positive correlation between the initial saturation of the initial main color and the saturation reduction amplitude, reduce the initial saturation of the initial main color, and based on the negative correlation between the initial brightness of the initial main color and the brightness increase amplitude, increase the initial brightness of the initial main color; if the text gray value is less than the second gray value threshold, based on the negative correlation between the initial saturation and the saturation increase amplitude, increase the initial saturation of the initial main color, and based on the positive correlation between the initial brightness and the brightness reduction amplitude, reduce the initial brightness of the initial main color; the first gray value threshold is greater than the second gray value threshold. Generate a main color image according to the adjusted main color; the main color image includes a target area that has been transparently processed. Generate a product thumbnail; wherein the product thumbnail displays the text information, the adjusted main color and the part of the pattern, the main color image is located above the part of the pattern, and when the target area corresponds to the part of the pattern in position, the part of the pattern can be displayed through the target area. Display the product thumbnail in the purchase interface of the user terminal for displaying multiple products; wherein the size of the product thumbnail displayed in the purchase interface is smaller than the size of the product image displayed in the product details interface.
7. A method for displaying a product, which is applied to a server, and the method includes: Receive the product image of the target product sent by the merchant terminal. The product image is used to be displayed in the product details interface of the target product on the user terminal running on the mobile terminal. The target product includes a benefit card. Obtain the initial main color of the product image, the number of pixels corresponding to the initial main color in the product image meets a preset quantity condition, and send the product image and the initial main color to the user terminal so that the user terminal executes the following process: Crop a partial pattern from the commodity image and extract the text information in the commodity image that represents the rights and interests provided by the rights and interests card; Adjust the obtained initial main color according to the text gray value preset according to the text information to obtain the adjusted main color; wherein, if the text gray value is greater than the first gray value threshold, based on the positive correlation between the initial saturation of the initial main color and the saturation reduction amplitude, reduce the initial saturation of the initial main color, and based on the negative correlation between the initial brightness of the initial main color and the brightness increase amplitude, increase the initial brightness of the initial main color; if the text gray value is less than the second gray value threshold, based on the negative correlation between the initial saturation and the saturation increase amplitude, increase the initial saturation of the initial main color, and based on the positive correlation between the initial brightness and the brightness reduction amplitude, reduce the initial brightness of the initial main color; the first gray value threshold is greater than the second gray value threshold; Generate a main color image according to the adjusted main color; the main color image includes a target area that has been transparently processed; Generate a commodity thumbnail; wherein, the commodity thumbnail displays the text information, the adjusted main color and the partial pattern, the main color image is located above the partial pattern, and the target area corresponds to the partial pattern in position, and the partial pattern can be displayed through the target area; Display the commodity thumbnail in a purchase interface for displaying multiple commodities on the user side; wherein, the size of the commodity thumbnail displayed in the purchase interface is smaller than the size of the commodity image displayed in the commodity details interface.
8. A method for displaying a commodity, applied to a user side, the method comprising: Receive a commodity image of a target commodity from a merchant side; The commodity image is used to be displayed in the commodity details interface of the target commodity on the user side running on a mobile terminal; The target commodity includes a rights and interests card; crop a partial pattern from the commodity image and extract the text information in the commodity image that represents the rights and interests provided by the rights and interests card; Obtain the initial main color of the commodity image, wherein the number of pixels corresponding to the initial main color in the commodity image meets a preset quantity condition; Adjust the obtained initial main color according to the text gray value preset according to the text information to obtain the adjusted main color; wherein, if the text gray value is greater than the first gray value threshold, based on the positive correlation between the initial saturation of the initial main color and the saturation reduction amplitude, reduce the initial saturation of the initial main color, and based on the negative correlation between the initial brightness of the initial main color and the brightness increase amplitude, increase the initial brightness of the initial main color; if the text gray value is less than the second gray value threshold, based on the negative correlation between the initial saturation and the saturation increase amplitude, increase the initial saturation of the initial main color, and based on the positive correlation between the initial brightness and the brightness reduction amplitude, reduce the initial brightness of the initial main color; the first gray value threshold is greater than the second gray value threshold; Generate a main color image according to the adjusted main color; the main color image includes a target area that has been made transparent; Generate a product thumbnail; wherein, the product thumbnail displays the text information, the adjusted main color and the partial pattern, the main color image is located on the upper layer of the partial pattern, and the target area corresponds to the partial pattern in position, and the partial pattern can be displayed through the target area; Display the product thumbnail in a purchase interface for displaying multiple products on the user side; wherein, the size of the product thumbnail displayed in the purchase interface is smaller than the size of the product image displayed in the product details interface.
9. The method according to claim 8, wherein the generating the product thumbnail includes: If the size of the product image does not match the size of the display area in the purchase interface, based on the size information of the display area, perform scaling and / or cropping processing on the product image, wherein the processed product image includes the partial pattern; superimpose the main color image on the upper layer of the processed product image to generate the product thumbnail; and / or If the size of the product image does not match the size of the display area in the purchase interface, superimpose the main color image on the upper layer of the product image; based on the size information of the display area, perform scaling and / or cropping processing on the superimposed image, and use the processed image as the product thumbnail.
10. The method according to claim 8, wherein the transparency processing includes transparency gradient transparency processing.
11. The method according to claim 8, the method further includes: If the product thumbnail is triggered, jump to the product details interface; The details interface displays the product image.
12. The method according to claim 8, wherein the product image includes the background image of the privilege card; the size of the background image of the privilege card in the purchase interface is smaller than the size of other product images in the purchase interface.
13. A display device for a product, the device includes: A first acquisition module, configured to: acquire a product image of a target product; the product image is used to be displayed in a product details interface of the target product running on a user side of a mobile terminal; the target product includes a privilege card; A second acquisition module, configured to: intercept a partial pattern from the product image and extract text information representing the privileges provided by the privilege card in the product image; Obtain the initial main color of the commodity image, where the number of pixels corresponding to the initial main color in the commodity image meets a preset quantity condition; adjust the obtained initial main color according to the preset text gray value of the text information to obtain the adjusted main color; wherein, if the text gray value is greater than the first gray value threshold, based on the positive correlation between the initial saturation of the initial main color and the saturation reduction amplitude, reduce the initial saturation of the initial main color, and based on the negative correlation between the initial brightness of the initial main color and the brightness increase amplitude, increase the initial brightness of the initial main color; if the text gray value is less than the second gray value threshold, based on the negative correlation between the initial saturation and the saturation increase amplitude, increase the initial saturation of the initial main color, and based on the positive correlation between the initial brightness and the brightness reduction amplitude, reduce the initial brightness of the initial main color; the first gray value threshold is greater than the second gray value threshold; generate a main color image according to the adjusted main color; the main color image includes a target area that has been transparently processed; A generation module, configured to: generate a commodity thumbnail; wherein, the commodity thumbnail displays the text information, the adjusted main color and the partial pattern, the main color image is located on the upper layer of the partial pattern, and the target area corresponds to the partial pattern in position, and the partial pattern can be displayed through the target area; A display module, configured to: display the commodity thumbnail in a purchase interface of the user terminal for displaying multiple commodities; wherein, the size of the commodity thumbnail displayed in the purchase interface is smaller than the size of the commodity image displayed in the commodity details interface.
14. An electronic device, the electronic device includes: A processor; A memory for storing processor-executable instructions; Wherein, when the processor calls the executable instructions, the operations of the method according to any one of claims 1-12 are implemented.
15. A computer program product, including a computer program, when the computer program is executed by a processor, the steps of the method according to any one of claims 1-12 are implemented.
16. A computer-readable storage medium, on which a number of computer instructions are stored, and when the computer instructions are executed, the method according to any one of claims 1-12 is executed.
Citation Information
Patent Citations
Method, device, server and readable storage medium for pushing dynamic advertisement
CN109472635A
Image processing method and device and electronic equipment
CN110599571A
Picture display method, picture processing method and system
CN111127302A
Image processing method and device, computer equipment and storage medium
CN113538601A