Icon generation method and device, storage medium and electronic device
By calling the program package on the graphical user interface to obtain images from the original file path and generate target icons, the problem of low icon generation efficiency is solved, and automated batch generation and efficiency improvement are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2022-11-15
- Publication Date
- 2026-08-04
AI Technical Summary
Current technologies have low efficiency in icon generation, and manual drawing is complex and has a low output rate, which cannot meet the large demand in application scenarios.
By determining the target type of the icon to be generated on the graphical user interface, calling the program package corresponding to the target type, obtaining multiple sets of original images from the original file path, converting them into target icons, using the program package to generate the target icons on the graphical user interface, and using plug-in tools for automated batch generation.
It enables automated batch generation of icons, improving generation efficiency, simplifying the icon generation process, reducing costs, and meeting a wide range of needs.
Smart Images

Figure CN115794089B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computers, and more specifically, to a method, apparatus, storage medium, and electronic device for generating icons. Background Technology
[0002] In related technologies, icons are mainly drawn manually. However, since icons need to be interactive and operable, and a large number of different types of icons need to be generated in different application scenarios, the manual drawing process is too complicated and has a low output rate, which cannot meet the large demand in application scenarios, thus leading to the technical problem of low efficiency in generating icons.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] At least some embodiments of the present invention provide a method, apparatus, storage medium, and electronic device for generating icons, so as to at least solve the technical problem of low icon generation efficiency.
[0005] According to one embodiment of the present invention, an icon generation method is provided. The method may include: determining the target type of the icon to be generated on a graphical user interface; calling a program package corresponding to the target type, wherein the program package is used to generate the icon to be generated on the graphical user interface; obtaining at least one set of original images from the original file path based on the program package, and converting each set of original images into a target icon corresponding to the first target file path to obtain at least one target icon.
[0006] According to one embodiment of the present invention, another method for generating an icon is also provided. The method may include: responding to a file input command acting on a graphical user interface, displaying an original file path and a first target file path on the graphical user interface; responding to an icon output command acting on the graphical user interface, outputting at least one target icon of a target type to the first target file path, wherein the at least one target icon is obtained by acquiring at least one set of original images from the original file path based on a program package corresponding to the target type, and converting based on each set of original images, and the program package is used to generate the icon to be generated on the graphical user interface.
[0007] According to one embodiment of the present invention, an icon generation apparatus is also provided. The apparatus may include: a determining unit for determining a target type of an icon to be generated on a graphical user interface; a calling unit for calling a program package corresponding to the target type, wherein the program package is used to generate the icon to be generated on the graphical user interface; and a processing unit for obtaining at least one set of original images from an original file path based on the program package, and converting each set of original images into a target icon corresponding to a first target file path, thereby obtaining at least one target icon.
[0008] According to one embodiment of the present invention, a readable storage medium is also provided, wherein a computer program is stored in the readable storage medium, wherein the computer program is configured to execute the icon generation method of any of the above-mentioned items when running.
[0009] According to one embodiment of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the icon generation method of any of the above.
[0010] In at least some embodiments of the present invention, the target type of the icon to be generated on the graphical user interface is determined; a program package corresponding to the target type is invoked, wherein the program package is used to generate the icon to be generated on the graphical user interface; at least one set of original images is obtained from the original file path based on the program package, and each set of original images is converted into a corresponding target icon in the first target file path, thereby obtaining at least one target icon. In other words, the embodiments of the present invention obtain multiple sets of original images from the original file path by invoking a program package corresponding to the target type of the icon to be generated on the graphical user interface, and converts each set of original images into a corresponding target icon, thereby obtaining multiple target icons, achieving the purpose of automated batch icon generation, thus improving the efficiency of icon generation and solving the technical problem of low icon generation efficiency. Attached Figure Description
[0011] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:
[0012] Figure 1 This is a hardware structure block diagram of a mobile terminal for an icon generation method according to an embodiment of the present invention.
[0013] Figure 2 This is a flowchart of an icon generation method according to an embodiment of the present invention;
[0014] Figure 3This is a flowchart of another method for generating icons according to an embodiment of the present invention;
[0015] Figure 4 A flowchart of a method for batch generating icons according to an embodiment of the present invention;
[0016] Figure 5 This is a schematic diagram of a plugin tool panel for batch generating icons according to an embodiment of the present invention;
[0017] Figure 6 This is a schematic diagram of an icon generation apparatus according to an embodiment of the present invention;
[0018] Figure 7 This is a schematic diagram of another icon generation apparatus according to an embodiment of the present invention;
[0019] Figure 8 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0020] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0021] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0022] According to one embodiment of the present invention, an embodiment of an icon generation method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0023] The above-described method embodiments of the present invention can be executed in a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, the mobile terminal can be a smartphone, tablet computer, PDA, mobile internet device, PAD, game console, or other terminal device. Figure 1 This is a hardware structure block diagram of a mobile terminal according to an embodiment of the present invention, which describes a method for generating icons. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. Processor 102 (processor 102 may include, but is not limited to, a central processing unit (CPU), graphics processing unit (GPU), digital signal processing (DSP) chip, microprocessor (MCU), programmable logic device (FPGA), neural network processor (NPU), tensor processor (TPU), artificial intelligence (AI) type processor, etc.) and memory 104 for storing data. In one embodiment of the present invention, it may also include: input / output device 108 and display device 110.
[0024] In some optional embodiments primarily focused on gaming scenarios, the aforementioned device may also provide a human-computer interaction interface with a touch-sensitive surface. This interface can sense finger contact and / or gestures to interact with a graphical user interface (GUI). The human-computer interaction functions may include the following: creating web pages, drawing, word processing, creating electronic documents, playing games, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital videos, playing digital music, and / or web browsing, etc. Executable instructions for performing the aforementioned human-computer interaction functions are configured / stored in one or more processor-executable computer program products or readable storage media.
[0025] Those skilled in the art will understand that Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0026] In one possible implementation, embodiments of the present invention provide a method for generating icons. Figure 2 This is a flowchart of an icon generation method according to an embodiment of the present invention, such as... Figure 2 As shown, the method includes the following steps:
[0027] Step S202: Determine the target type of the icon to be generated on the graphical user interface.
[0028] In the technical solution provided in step S202 of the present invention, the graphical user interface can be an operation user interface that is displayed in a graphical manner, such as the operation interface of a mobile phone or the operation interface of a computer. The icon can be a user interface icon (UI), which can represent a picture or object on the graphical user interface. The icon can be used to quickly execute commands, such as opening a file, program, webpage or command. The target type can be the generation type of the icon to be generated. The icon to be generated can include a single-layer icon, a multi-layer icon and a single-layer action icon.
[0029] Optionally, taking the generation of water mist material icons as an example, the icons to be generated can include single-layer water mist icons, multi-layer water mist icons, and single-layer water mist action icons.
[0030] Step S204: Call the program package corresponding to the target type, wherein the program package is used to generate the icon to be generated on the graphical user interface.
[0031] In the technical solution provided by step S204 of the present invention, after determining the target type of the icon to be generated, a program package corresponding to the target type can be called. The program package is used to generate the icon to be generated on the graphical user interface. The program package may include multiple pre-made programs for generating icons. For example, the program package may include a single-layer icon package, a double-layer icon package, and a double-layer action icon package.
[0032] For example, if the target type is a single-layer water mist icon, the single-layer water mist icon can be generated on the graphical user interface by calling the single-layer water mist icon package; if the target type is a double-layer water mist icon, the double-layer water mist icon can be generated on the graphical user interface by calling the double-layer water mist icon package; if the target type is a single-layer water mist action icon, the single-layer water mist action icon can be generated on the graphical user interface by calling the single-layer water mist action icon package.
[0033] Step S206: Based on the program package, obtain at least one set of original images from the original file path, and convert each set of original images into the corresponding target icon in the first target file path to obtain at least one target icon.
[0034] In the technical solution provided by step S206 of the present invention, at least one set of original images can be stored in the original file path in advance. Then, the original file path is input into the program package, at least one set of original images is obtained from the original file path, and each set of original images is converted into a target icon corresponding to the first target file path through the program package to obtain at least one target icon. The original file path can be the path of the input folder, the original image can be a pre-made white bitmap of the icon to be generated, the white bitmap refers to a bitmap filled with white, and the bitmap is a raster image composed of many pixels. The first target file path can be the path of the output folder. Both the original file path and the first target file path can be represented by a Uniform Resource Locator (URL) path. This is only an example and is not specifically limited.
[0035] Alternatively, within the program package, the white bitmap can be imported into the program package of the drawing tool (Substance Designer) to automatically generate target icons in batches. However, Substance Designer's files can only handle images of powers of 2 pixels, while icons are generally smaller than 256*256 pixels. Therefore, the image processing module (Python Imaging Library, or PIL for short) in the scripting language (Python) can be used to stretch the white bitmap to 256*256 pixels before importing it into the Substance Designer program package.
[0036] Optionally, after generating the target icon, the target icon can be given a custom name, and the intermediate process files generated during the generation of the target icon can be exported. Then, the intermediate process files can be used to automatically synthesize graphic files (Photoshop Document, or PSD for short) to achieve the technical effect of facilitating manual adjustment and modification of the generated target icon.
[0037] Optionally, multiple program packages used to generate different types of icons can be packaged into a plugin tool for generating icons. Using this plugin tool, multiple different types of icons can be automatically generated in batches. That is, the icons generated by the plugin tool have the characteristics of large generation quantity and fast generation speed, thereby achieving the technical effect of improving the efficiency of icon generation.
[0038] It should be noted that, compared with the icon generation methods in related technologies, the icon generation speed through the above-mentioned plug-in tool has also been improved, thereby further improving the efficiency of icon generation. For example, it takes one day to manually create an icon artistically, while the above-mentioned plug-in tool only takes 30 seconds.
[0039] Through steps S202 to S206 of the present invention, the target type of the icon to be generated on the graphical user interface is determined; a program package corresponding to the target type is called, wherein the program package is used to generate the icon to be generated on the graphical user interface; at least one set of original images is obtained from the original file path based on the program package, and each set of original images is converted into the corresponding target icon in the first target file path, thereby obtaining at least one target icon. In other words, the embodiments of the present invention, by calling the program package corresponding to the target type of the icon to be generated on the graphical user interface, obtain multiple sets of original images from the original file path, and convert each set of original images into the corresponding target icon, thereby obtaining multiple target icons, achieve the purpose of automated batch icon generation, thus improving the efficiency of icon generation and solving the technical problem of low icon generation efficiency.
[0040] The method described above in this embodiment will be further described below.
[0041] As an optional implementation, step S206, obtaining at least one set of original images from the original file path based on the program package, includes: obtaining the original file path of the input node linked to the program package; and obtaining at least one set of original images from the original file path.
[0042] In this embodiment, the original file path that can be linked to the input node of the program package is obtained, and multiple sets of original images in the original file path are traversed to obtain at least one set of original images. The obtained original images are then converted into target icons. The original file path that can be linked to the input node of the program package can be selected by the path selection box on the program package. For example, the original file path can be selected from multiple file paths by the import address selection box on the plug-in tool interface. The files stored under the selected original file path are image files.
[0043] As an optional implementation, the method may further include obtaining the original file path of the input node linked to the program package, including: calling the target interface to read the original file path linked to the input node.
[0044] In this embodiment, the original file path linked to the input node can be read by calling the target interface and input into the pre-made program package. The target interface can be the application programming interface (API) exposed by Substance Designer.
[0045] As an optional implementation, the method may further include obtaining at least one set of original images from the original file path, including: obtaining original images whose target image size matches the program package from the original file path to obtain at least one set of original images.
[0046] In this embodiment, before converting the original image into the target icon, the original image whose size matches that of the program package can be obtained from the original file path. This ensures that the image size of the original image meets the image size requirements of the program package for image processing. For example, if the program package can only process images of powers of 2 pixels, the original image can be stretched to 256*256 pixels using the PIL image processing module in Python before being imported into the program package. The target image size can be the image size obtained by adjusting the original image size of the original image. The original image size can be the original image size of the original image, such as the image size of a pre-made white bitmap.
[0047] As an optional implementation, step S206, converting each set of original images into a corresponding target icon in the first target file path, includes: based on the program package, converting each set of original images into a target icon in the first target file path with an image size equal to the original image size.
[0048] In this embodiment, since the image size of the original image in the original file path is adjusted to match the image size of the program package before converting the original image into the target icon, after generating the target icon corresponding to the original image using the program package, it is necessary to restore the image size of the generated target icon to the original image size. That is, each group of original images is converted into a target icon in the first target file path with the original image size. For example, the resize function in the PIL module of Python's image processing can be used to restore the image size of each group of original images to the original image size.
[0049] As an optional implementation, step S206, converting each set of original images into a target icon corresponding to the first target file path, includes: obtaining the color information of each set of original images based on the program package, and generating the target icon corresponding to the first target file path based on the color information of each set of original images.
[0050] In this embodiment, the color information of each set of original images can be obtained by linking the original file path of the original image to the input node of the program package. Then, the target icon corresponding to the first target file path can be generated based on the obtained color information of each set of original images. The color information may include red channel information, green channel information, blue channel information and alpha channel information.
[0051] As an optional implementation, step S206, converting each group of original images into a target icon corresponding to the first target file path, includes: in response to the program package corresponding to the single-layer water mist icon type, blurring one original image in each group of original images based on a random mask in the program package to obtain a blurred image; performing pixel distortion processing on the blurred image in the program package, or blurring the blurred image based on an original image to obtain a target icon of the single-layer water mist icon type corresponding to the first target file path.
[0052] In this embodiment, if the program package corresponds to the single-layer water mist icon type, the single-layer water mist icon program can be called. First, a random mask generated in the program package is used to blur each original image in each group of original images. Then, the previously randomly generated random mask is superimposed and blurred again. Finally, the pixel distortion algorithm is used to perform pixel distortion processing on the blurred image obtained after the two blurring processes to obtain the target icon of the single-layer water mist icon type with the clickable icon effect. Here, the random mask can be a randomly generated mask, which can be black and white and stores 0 and 1 information respectively. 0 means that no processing is done on the pixel, and 1 means that the pixel is processed. The clickable icon effect can be the effect triggered when the icon is touched. For example, if the icon is clicked by a finger, and the finger is pressed and held, the clickable icon effect will be maintained.
[0053] Optionally, after obtaining the images after the above two blurring processes, the original image can be used as a mask for overlay to generate the effect of pixel edge overflow. The resulting image can be a target icon of the single-layer water mist icon type with a normal icon effect. The normal icon effect can be used to simulate the effect of hand-painting a part.
[0054] As an optional implementation, step S206, converting each set of original images into a target icon corresponding to the first target file path, includes: in response to the program package corresponding to the double-layer water mist icon type, offsetting the first original image in each set of original images in the program package to obtain a target mask; occluding the second original image in each set of original images based on the target mask in the program package to obtain a target icon of the double-layer water mist icon type corresponding to the first target file path, wherein the second original image is located below the first original image.
[0055] In this embodiment, the dual-layer water mist icon may include an upper water mist icon and a lower water mist icon. If the program package corresponds to the dual-layer water mist icon type, the dual-layer water mist icon program can be called. First, the first original image in each group of original images is offset in the program package to obtain a target mask. Then, the second original image in each group of original images is partially occluded through the target mask to generate a shadow-like effect, thus obtaining a target icon of the dual-layer water mist icon type. The first original image can be the original image of the upper water mist icon, and the second original image can be the original image of the lower water mist icon.
[0056] As an optional implementation, step S206, converting each set of original images into a target icon corresponding to the first target file path, includes: in response to the program package corresponding to the single-layer water mist action icon type, obtaining the light information of one original image in each set of original images in the program package; and generating a target icon of the single-layer water mist action icon type corresponding to the first target file path in the program package based on the light information.
[0057] In this embodiment, if the program package corresponds to the single-layer water mist action icon type, the single-layer water mist action icon program can first obtain the light information of each original image in each group of original images from the program package, and then use the light information in the program package to achieve the effect of generating inner and outer light emission, thereby generating a target icon of the single-layer water mist action icon type. The light information can be the light emission information of the target icon, such as ambient occlusion.
[0058] As an optional implementation, the method may further include: generating an edit file for each target icon based on each target icon and each corresponding set of original images, wherein the edit file is used to edit each target icon file; and outputting the edit file for each target icon to a second target file path.
[0059] In this embodiment, after converting each set of original images into the corresponding target icon in the first target file path, the image stitching (wand) module of Python can be used to call the programming language (C++) of the image processing software (Image Magick) to generate an editing file for each target icon based on each target icon and the corresponding set of original images. The editing file of each target icon is then output to the second target file path to achieve the technical effect of facilitating manual adjustment and modification of the generated icons. The editing file of the target icon can be a PSD format file, in which the icon effects of all target icons are saved in separate layers, and each layer can be edited. The second target file path can be an export folder path, under which multiple editing files of target icons can be stored.
[0060] Optionally, the above program package can be encapsulated into a plugin using the Python application creation toolkit (pyqt) to generate an icon generation tool. The tool panel of the plugin tool can also display some internal node parameters of Substance Designer to facilitate the adjustment of icon effects.
[0061] This invention also provides another method for generating icons, which can be applied to the interactive side. Figure 3 This is a flowchart of another icon generation method according to an embodiment of the present invention, such as... Figure 3 As shown, the method includes the following steps:
[0062] Step S302: In response to a file input command applied to the graphical user interface, the original file path and the first target file path are displayed on the graphical user interface.
[0063] In the technical solution provided by step S302 of the present invention, if a file input command is received acting on the graphical user interface, the original file path and the first target file path can be displayed on the graphical user interface. The graphical user interface can be the operation interface of a plug-in tool for generating icons. The plug-in tool can be obtained by plugging in multiple pre-made program packages for generating icons. The file input command can be used to input a white bitmap of the icon to be generated on the plug-in tool. The original file path can be the path of the input folder, under which the white bitmap of the icon to be generated can be stored. The first target file path can be the path of the output folder, under which the icon generated by the plug-in tool can be stored.
[0064] Step S304: In response to the icon output instruction applied to the graphical user interface, at least one target icon of the target type is output to the first target file path. The at least one target icon is obtained by acquiring at least one set of original images from the original file path based on the program package corresponding to the target type, and is converted based on each set of original images. The program package is used to generate the icon to be generated on the graphical user interface.
[0065] In the technical solution provided by step S304 of the present invention, after receiving the icon output instruction acting on the graphical user interface, at least one target icon of the target type can be output to the first target file path. The target type may include a single-layer water mist icon, a double-layer water mist action icon, and a single-layer water mist action icon. The target icon may be an icon generated by a plug-in tool.
[0066] Optionally, after receiving the icon output instruction applied to the graphical user interface, an edit file for each target icon can also be output, achieving the technical effect of facilitating manual adjustment and modification of the generated icons.
[0067] Through steps S302 to S304 of the present invention, in response to a file input command applied to the graphical user interface, the original file path and the first target file path are displayed on the graphical user interface; in response to an icon output command applied to the graphical user interface, at least one target icon of the target type is output to the first target file path, wherein the at least one target icon is obtained from at least one set of original images obtained from the original file path based on a program package corresponding to the target type, and is converted based on each set of original images. The program package is used to generate the icon to be generated on the graphical user interface, so as to achieve the purpose of automated batch generation of icons, thereby achieving the technical effect of improving the efficiency of icon generation, and thus solving the technical problem of low efficiency in icon generation.
[0068] The technical solutions of the present invention will be further illustrated below with reference to preferred embodiments.
[0069] In game scenarios, due to the need for interactivity and operability, a large number of different types of UI icons need to be generated. For an operating game product, even if the style of UI icons has been determined in the early stage of game development, continuous content updates will also generate the need for UI icons of the same style.
[0070] Standard UI icons require basic graphic design and corresponding style depiction. One related technology provides a method for generating water mist UI icons. This method can include: drawing a graphic; creating a mask and erasing its edges to obtain a silhouette graphic after mask erasure; randomly blurring the silhouette graphic to add icon details, resulting in a silhouette icon with added blur details; creating a clipping mask and adding a water mist material to obtain a portable network graphics (PNG); naming it according to rules; and uploading it to the corresponding folder in the project version control system (Subversion, SVN).
[0071] However, the above methods mainly rely on manual creation of UI icons, which is complex, costly, and has a low output rate. For continuously operating games, the demand for UI icons increases with game content updates, and the expected diversity also increases. This method cannot meet the large demand in the game, resulting in the technical problem of low efficiency in icon generation.
[0072] However, this invention proposes a method and tool for batch automated generation of icons. This method can simplify the complex style depiction process in icon generation, generate icons in batches, thereby avoiding repetitive work and repeated modifications, achieving the goal of reducing costs and freeing up manpower, thus realizing the technical effect of improving the efficiency of icon generation and solving the technical problem of low icon generation efficiency.
[0073] The next step will take the generation of water mist icons as an example to further introduce a method for batch automated generation of icons provided by an embodiment of the present invention.
[0074] Figure 4 A flowchart of a method for batch generating icons according to an embodiment of the present invention is shown below. Figure 4 As shown, the method may include the following steps:
[0075] Step S401: Prepare a program to generate programmed water mist icons.
[0076] In the technical solution of step S401 of the present invention, a program for creating a procedural water mist icon can be created in Substance Designer by using an encapsulated image processing algorithm. The program for the water mist icon can be the logic of the water mist icon, including single-layer water mist skill icon logic, multi-layer water mist skill icon logic, and single-layer water mist action icon logic.
[0077] Optionally, the main principle of the single-layer water mist skill icon logic is to blur the white bitmap by randomly generating a mask, then overlay the previously randomly generated mask, perform a blur algorithm, and finally use the original image as a second mask to generate a pixel edge overflow effect. This effect can simulate the effect of hand-painting a part, generating the normal icon effect of the water mist icon. At the same time, the overall blur algorithm and pixel distortion algorithm can be used to programmatically generate the click-state icon effect of the water mist icon. Finally, by overlaying the water mist texture, the generated black and white image is mixed as the Alpha channel to obtain the single-layer water mist skill icon. Here, the mask is black and white and stores 0 and 1 information. 0 means that the pixel is not processed and 1 means that the pixel is processed. The click-state icon effect can be the effect triggered when the icon is touched. For example, by clicking the icon with a finger, if the finger is pressed and held, the click-state icon effect will be maintained.
[0078] Optionally, the logic for the double-layer water mist skill icon is basically similar to that for the single-layer water mist skill icon. It requires importing two images, namely, the upper icon and the lower icon. A mask needs to be generated on the lower icon by offsetting the upper icon to partially obscure the lower icon, thereby producing a shadow-like effect.
[0079] Optionally, the normal state of the single-layer water mist action icon is created in the same way as the click state of the single-layer water mist skill icon. However, the click state needs to reproduce the color overlay, inner glow, and outer glow effects of the drawing software (Photoshop). In Substance Designer, the inner glow and outer glow effects can be generated by generating Ambient Occlusion. Finally, the blend mode between different layers is adjusted to synthesize the final icon display effect.
[0080] Step S402: Batch import the white bitmaps into the plugin tool.
[0081] In the technical solution of step S402 of the present invention, Python is used in Substance Designer to batch traverse the image format files under the input path folder.
[0082] Alternatively, since Substance Designer can only handle images of powers of 2 pixels, and the icons in the project are generally smaller than 256*256 pixels, the white bitmap can be stretched to 256*256 pixels using the PIL image processing module in Python before being imported into Substance Designer.
[0083] Step S403: Based on the pre-made program for generating programmed water mist icons and the batch-imported white bitmaps, programmatically generate water mist icons.
[0084] In the technical solution of step S403 of the present invention, the URL paths of all imported white bitmaps are traversed, the internal software path URL of each white bitmap is read using the API opened by Substance Designer, and input into the pre-written program that programmatically generates water mist. Before inputting, it is necessary to determine the image logic currently being processed.
[0085] Optionally, if the logic of the currently processed image is a single-layer water mist skill icon logic, then the URL path of the white bitmap in the software is linked to the input node in the single-layer water mist skill icon logic; if the logic of the currently processed image is a double-layer water mist skill icon logic, then the URL path of the white bitmap in the software is linked to the input node in the double-layer water mist skill icon logic; if the logic of the currently processed image is a single-layer water mist action icon logic, then the URL path of the white bitmap in the software is linked to the input node in the single-layer water mist action icon logic, ultimately obtaining the information of the four channels Red, Green, Blue, and Alpha of the normal state and click state of the water mist icon.
[0086] Step S404: Export the generated water mist icons in batches.
[0087] In the technical solution of step S404 of the present invention, all output images are traversed, and the images are exported through the API of SubstanceDesigner. At the same time, the resize function in the PIL module is used to restore the images to their original size and save them as PNG format. Meanwhile, a counter is defined in the program, and the project file is renamed using the module in Python used to access the operating system (OS) and the counter. Finally, a PNG format file of the icon named according to the format is obtained. The output image is the generated water mist icon.
[0088] Alternatively, the wand module of Python can be used to call the C++ module of Image Magick to write the intermediate files into a PSD file in layers. That is, all the icon effects stored in the PSD file are layered separately, and each layer can be edited, so as to achieve the technical effect of facilitating manual adjustment and modification of the generated icons.
[0089] It should be noted that in this embodiment of the invention, the above operations are also encapsulated using PyQt in Python, resulting in a plugin tool for batch generating icons. In the plugin tool, you only need to input the address of the folder to be imported and the address of the folder to be exported to automatically execute the above steps. At the same time, the plugin tool also places some SubstanceDesigner internal node parameters in the tool panel to facilitate the adjustment of icon effects.
[0090] It should be noted that the plug-in tool in this embodiment of the invention can be used to generate various types of icons. The water mist icon is only an example, and no specific limitation is made on the type of icon to be generated here.
[0091] Figure 5 This is a schematic diagram of a plugin tool panel for batch generating icons according to an embodiment of the present invention, such as... Figure 5 As shown, the plugin tool panel displays some Substance Designer internal node parameters, such as blur noise, random values, color, hue, saturation, brightness, as well as import and export addresses, thereby achieving the technical effect of actively adjusting the generated icon effect.
[0092] The embodiments of the present invention, through a fixed process, pre-made icon generation logic and batch processing scheme, not only improve production efficiency, but also achieve a unified art standard for the quality of the generated icons, realizing an industrial effect. Furthermore, it can generate icons of various materials, making them highly reusable.
[0093] In this embodiment of the invention, by placing the white bitmaps of the basic graphic icons into the same folder, the smearing effect, blurring effect, and partial blurring effect of the water mist icon are implemented programmatically in Substance Designer, and saved as three logics: single-layer skill icon, multi-layer skill icon, and single-layer action icon. Then, the program logic is stored, and inputting the white bitmap of the icon will automatically output the corresponding icon and a modifiable PSD file, thereby solving the technical problem of low icon generation efficiency and achieving the technical effect of improving icon generation efficiency.
[0094] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.
[0095] This embodiment also provides an icon generation apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the terms "unit" and "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0096] Figure 6 This is a schematic diagram of an icon generation apparatus according to an embodiment of the present invention, such as... Figure 6 As shown, the icon generation device 600 includes: a determining unit 601, a calling unit 602, and a processing unit 603.
[0097] The determining unit 601 is used to determine the target type of the icon to be generated on the graphical user interface.
[0098] Calling unit 602 is used to call the program package corresponding to the target type, wherein the program package is used to generate the icon to be generated on the graphical user interface.
[0099] The processing unit 603 is used to obtain at least one set of original images from the original file path based on the program package, and to convert each set of original images into a corresponding target icon in the first target file path to obtain at least one target icon.
[0100] Optionally, the processing unit 603 includes: a first acquisition module for acquiring the original file path of the input node linked to the program package; and a second acquisition module for acquiring at least one set of original images from the original file path.
[0101] Optionally, the first acquisition module includes: a calling submodule for calling the target interface to read the original file path linked to the input node.
[0102] Optionally, the second acquisition module includes: a first acquisition module submodule, used to acquire an original image whose target image size matches the program package from the original file path, to obtain at least one set of original images, wherein the target image size is obtained by adjusting the original image size of the original images.
[0103] Optionally, the processing unit 603 includes a conversion module for converting each set of original images into target icons in a first target file path with the same image size as the original images, based on the program package.
[0104] Optionally, the processing unit 603 includes: a first generation module, configured to obtain color information of each set of original images based on the program package, and generate a target icon corresponding to the first target file path based on the color information of each set of original images.
[0105] Optionally, the processing unit 603 includes: a first processing module, configured to, in response to the program package corresponding to the single-layer water mist icon type, perform blurring processing on one original image in each group of original images based on random masking in the program package to obtain a blurred image; and a second processing module, configured to perform pixel distortion processing on the blurred image in the program package, or to perform blurring processing on the blurred image based on an original image to obtain a target icon of the single-layer water mist icon type corresponding to the first target file path.
[0106] Optionally, the processing unit 603 includes: an offset module, configured to offset the first original image in each group of original images in the program package in response to the program package corresponding to the double-layer water mist icon type, to obtain a target mask; and an occlusion module, configured to occlude the second original image in each group of original images in the program package based on the target mask, to obtain a target icon of the double-layer water mist icon type corresponding to the first target file path, wherein the second original image is located below the first original image.
[0107] Optionally, the processing unit 603 includes: a third acquisition module, used to acquire the light information of one original image in each group of original images in response to the program package corresponding to the single-layer water mist action icon type; and a second generation module, used to generate a target icon of the single-layer water mist action icon type corresponding to the first target file path in the program package based on the light information.
[0108] Optionally, the apparatus further includes: a generation unit, configured to generate an edit file for each target icon based on each target icon and each corresponding set of original images, wherein the edit file is used to edit each target icon file; and output the edit file for each target icon to a second target file path.
[0109] In the icon generation apparatus of this embodiment, a determining unit is used to determine the target type of the icon to be generated on the graphical user interface; a calling unit is used to call a program package corresponding to the target type, wherein the program package is used to generate the icon to be generated on the graphical user interface; and a processing unit is used to obtain at least one set of original images from the original file path based on the program package, and to convert each set of original images into a target icon corresponding to the first target file path to obtain at least one target icon, so as to achieve the purpose of automatically generating icons in batches, thereby achieving the technical effect of improving the efficiency of icon generation and solving the technical problem of low efficiency in icon generation.
[0110] Figure 7 This is a schematic diagram of another icon generation apparatus according to an embodiment of the present invention, such as... Figure 7 As shown, the icon generation device 700 includes a display unit 701 and an output unit 702.
[0111] Display unit 701 is used to respond to file input commands applied to the graphical user interface and display the original file path and the first target file path on the graphical user interface.
[0112] Output unit 702 is used to respond to an icon output command applied to a graphical user interface and output at least one target icon of a target type to a first target file path. The at least one target icon is obtained by acquiring at least one set of original images from the original file path based on a program package corresponding to the target type and converting each set of original images. The program package is used to generate the icon to be generated on the graphical user interface.
[0113] In the icon generation apparatus of this embodiment, the display unit is used to display the original file path and the first target file path on the graphical user interface in response to a file input command applied to the graphical user interface; the output unit is used to output at least one target icon of the target type to the first target file path in response to an icon output command applied to the graphical user interface. The at least one target icon is obtained by acquiring at least one set of original images from the original file path based on a program package corresponding to the target type, and is converted based on each set of original images. The program package is used to generate the icon to be generated on the graphical user interface to achieve the purpose of automatically generating icons in batches, thereby achieving the technical effect of improving the efficiency of icon generation and solving the technical problem of low efficiency in icon generation.
[0114] It should be noted that the above-mentioned units and modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but not limited to these: all the above-mentioned units and modules are located in the same processor; or, the above-mentioned units and modules are located in different processors in any combination.
[0115] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.
[0116] Optionally, in this embodiment, the computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0117] Optionally, in this embodiment, the computer-readable storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0118] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0119] S1, Determine the target type of the icon to be generated on the graphical user interface;
[0120] S2, call the program package corresponding to the target type, where the program package is used to generate the icon to be generated on the graphical user interface;
[0121] S3: Based on the program package, obtain at least one set of original images from the original file path, and convert each set of original images into the corresponding target icon in the first target file path to obtain at least one target icon.
[0122] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: obtaining the original file path of the input node linked to the program package; obtaining at least one set of original images from the original file path.
[0123] Optionally, the aforementioned computer-readable storage medium is also configured to store program code for performing the following steps: calling the target interface to read the original file path linked to the input node.
[0124] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: obtaining an original image from the original file path whose target image size matches the program package, and obtaining at least one set of original images, wherein the target image size is obtained by adjusting the original image size of the original images.
[0125] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: converting each set of original images into target icons in a first target file path with image dimensions equal to the original image dimensions, based on the program package.
[0126] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: obtaining color information of each set of original images based on the program package, and generating a target icon corresponding to the first target file path based on the color information of each set of original images.
[0127] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: in response to a program package corresponding to a single-layer water mist icon type, blurring one original image in each group of original images based on a random mask in the program package to obtain a blurred image; performing pixel distortion processing on the blurred image in the program package, or blurring the blurred image based on an original image to obtain a target icon of the single-layer water mist icon type corresponding to the first target file path.
[0128] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: in response to a program package corresponding to a double-layer water mist icon type, offsetting a first original image in each group of original images in the program package to obtain a target mask; occluding a second original image in each group of original images based on the target mask in the program package to obtain a target icon of the double-layer water mist icon type corresponding to a first target file path, wherein the second original image is located below the first original image.
[0129] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: in response to a program package corresponding to a single-layer water mist action icon type, acquiring light information of one original image in each group of original images in the program package; and generating a target icon of the single-layer water mist action icon type corresponding to the first target file path in the program package based on the light information.
[0130] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: generating an edit file for each target icon based on each target icon and each corresponding set of original images, wherein the edit file is used to edit each corresponding target icon file; and outputting the edit file for each target icon to a second target file path.
[0131] In the computer-readable storage medium of this embodiment, by determining the target type of the icon to be generated on the graphical user interface; calling the program package corresponding to the target type, wherein the program package is used to generate the icon to be generated on the graphical user interface; obtaining at least one set of original images from the original file path based on the program package, and converting each set of original images into the target icon corresponding to the first target file path, at least one target icon is obtained, so as to achieve the purpose of automatically generating icons in batches, thereby achieving the technical effect of improving the efficiency of icon generation, and thus solving the technical problem of low efficiency in icon generation.
[0132] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0133] S1, responding to file input commands applied to the graphical user interface, displays the original file path and the first target file path on the graphical user interface;
[0134] S2, responding to an icon output command applied to the graphical user interface, outputs at least one target icon of the target type to the first target file path, wherein the at least one target icon is obtained from the original file path based on a program package corresponding to the target type, and is converted based on each set of original images, and the program package is used to generate the icon to be generated on the graphical user interface.
[0135] In the computer-readable storage medium of this embodiment, in response to a file input command acting on a graphical user interface, an original file path and a first target file path are displayed on the graphical user interface; in response to an icon output command acting on the graphical user interface, at least one target icon of a target type is output to the first target file path, wherein the at least one target icon is obtained by acquiring at least one set of original images from the original file path based on a program package corresponding to the target type, and is converted based on each set of original images. The program package is used to generate the icon to be generated on the graphical user interface to achieve the purpose of automatically generating icons in batches, thereby achieving the technical effect of improving the efficiency of icon generation and solving the technical problem of low efficiency in icon generation.
[0136] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of the present invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (such as a CD-ROM, USB flash drive, portable hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the method according to the embodiments of the present invention.
[0137] In exemplary embodiments of the present invention, a computer-readable storage medium stores a program product capable of implementing the methods described above in this embodiment. In some possible implementations, various aspects of the embodiments of the present invention can also be implemented as a program product comprising program code, which, when run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this embodiment according to various exemplary embodiments of the present invention.
[0138] According to embodiments of the present invention, a program product for implementing the above-described method may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In the embodiments of the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0139] The aforementioned program product may take the form of any combination of one or more computer-readable media. Such computer-readable storage media may be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples (not exhaustive) of computer-readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0140] It should be noted that the program code contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0141] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0142] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0143] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0144] S1, Determine the target type of the icon to be generated on the graphical user interface;
[0145] S2, call the program package corresponding to the target type, where the program package is used to generate the icon to be generated on the graphical user interface;
[0146] S3: Based on the program package, obtain at least one set of original images from the original file path, and convert each set of original images into the corresponding target icon in the first target file path to obtain at least one target icon.
[0147] Optionally, the processor described above may also be configured to perform the following steps via a computer program: obtaining the original file path of the input node linked to the program package; and obtaining at least one set of original images from the original file path.
[0148] Optionally, the processor described above can also be configured to perform the following steps via a computer program: calling the target interface to read the original file path linked to the input node.
[0149] Optionally, the processor may also be configured to perform the following steps via a computer program: obtaining an original image whose target image size matches the program package size from the original file path, and obtaining at least one set of original images, wherein the target image size is obtained by adjusting the original image size of the original images.
[0150] Optionally, the processor described above may also be configured to perform the following steps via a computer program: based on the program package, convert each set of original images into a target icon in a first target file path with the image size of the original image.
[0151] Optionally, the processor may also be configured to perform the following steps via a computer program: obtaining color information of each set of original images based on the program package, and generating a target icon corresponding to the first target file path based on the color information of each set of original images.
[0152] Optionally, the processor may also be configured to perform the following steps via a computer program: in response to a program package corresponding to a single-layer water mist icon type, blurring one original image in each group of original images based on a random mask in the program package to obtain a blurred image; performing pixel distortion processing on the blurred image in the program package, or blurring the blurred image based on an original image to obtain a target icon of the single-layer water mist icon type corresponding to the first target file path.
[0153] Optionally, the processor may also be configured to perform the following steps via a computer program: in response to the program package corresponding to the double-layer water mist icon type, offsetting the first original image in each group of original images in the program package to obtain a target mask; occluding the second original image in each group of original images based on the target mask in the program package to obtain a target icon of the double-layer water mist icon type corresponding to the first target file path, wherein the second original image is located below the first original image.
[0154] Optionally, the processor may also be configured to perform the following steps via a computer program: in response to the program package corresponding to the single-layer water mist action icon type, obtain the light information of one original image in each group of original images in the program package; and generate a target icon of the single-layer water mist action icon type corresponding to the first target file path in the program package based on the light information.
[0155] Optionally, the processor described above may also be configured to perform the following steps via a computer program: generating an edit file for each target icon based on each target icon and each corresponding set of original images, wherein the edit file is used to edit each target icon file; and outputting the edit file for each target icon to a second target file path.
[0156] In the electronic device of this embodiment, by determining the target type of the icon to be generated on the graphical user interface; calling the program package corresponding to the target type, wherein the program package is used to generate the icon to be generated on the graphical user interface; obtaining at least one set of original images from the original file path based on the program package, and converting each set of original images into the target icon corresponding to the first target file path, at least one target icon is obtained, so as to achieve the purpose of automatically generating icons in batches, thereby achieving the technical effect of improving the efficiency of icon generation, and thus solving the technical problem of low efficiency in icon generation.
[0157] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0158] S1, responding to file input commands applied to the graphical user interface, displays the original file path and the first target file path on the graphical user interface;
[0159] S2, responding to an icon output command applied to the graphical user interface, outputs at least one target icon of the target type to the first target file path, wherein the at least one target icon is obtained from the original file path based on a program package corresponding to the target type, and is converted based on each set of original images, and the program package is used to generate the icon to be generated on the graphical user interface.
[0160] In the electronic device of this embodiment, in response to a file input command applied to a graphical user interface, an original file path and a first target file path are displayed on the graphical user interface; in response to an icon output command applied to the graphical user interface, at least one target icon of the target type is output to the first target file path, wherein the at least one target icon is obtained by acquiring at least one set of original images from the original file path based on a program package corresponding to the target type, and is converted based on each set of original images. The program package is used to generate the icon to be generated on the graphical user interface, so as to achieve the purpose of automatically generating icons in batches, thereby achieving the technical effect of improving the efficiency of icon generation, and thus solving the technical problem of low efficiency in icon generation.
[0161] Figure 8 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Figure 8 As shown, the electronic device 800 is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0162] like Figure 8 As shown, the electronic device 800 is presented in the form of a general-purpose computing device. The components of the electronic device 800 may include, but are not limited to: at least one processor 810, at least one memory 820, a bus 830 connecting different system components (including memory 820 and processor 810), and a display 840.
[0163] The memory 820 stores program code that can be executed by the processor 810, causing the processor 810 to perform the steps described in the method section of the embodiments of the present invention according to various exemplary implementations of the present invention.
[0164] The memory 820 may include a readable medium in the form of volatile memory cells, such as random access memory (RAM) 8201 and / or cache memory 8202, and may further include read-only memory (ROM) 8203, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
[0165] In some instances, memory 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, including but not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Memory 820 may further include memory remotely located relative to processor 810, which can be connected to electronic device 800 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0166] Bus 830 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, peripheral bus, graphics acceleration port, processor 810, or a local bus using any of the various bus structures.
[0167] The display 840 may be, for example, a touchscreen liquid crystal display (LCD) that allows a user to interact with the user interface of the electronic device 800.
[0168] Optionally, the electronic device 800 can also communicate with one or more external devices 800 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 800, and / or any device that enables the electronic device 800 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via the input / output (I / O) interface 850. Furthermore, the electronic device 800 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via a network adapter 860. Figure 8 As shown, network adapter 860 communicates with other modules of electronic device 800 via bus 830. It should be understood that, although... Figure 8 As not shown, other hardware and / or software modules may be used in conjunction with electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0169] The aforementioned electronic device 800 may also include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply, and / or a camera.
[0170] Those skilled in the art will understand that Figure 8The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, the electronic device 800 may also include components that are more... Figure 8 The more or fewer components shown, or having the same Figure 1 Different configurations are shown. The memory 820 can be used to store computer programs and corresponding data, such as the computer program and corresponding data corresponding to the method in this embodiment of the invention. The processor 810 executes various functional applications and data processing by running the computer program stored in the memory 820, thereby implementing the above-described method.
[0171] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0172] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0173] In the several embodiments provided by this invention, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection can be through some interfaces; the indirect coupling or communication connection of units or modules can be electrical or other forms.
[0174] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0175] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0176] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0177] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method of generating an icon, characterized by, include: Determine the target type of the icon to be generated on the graphical user interface; Invoke the program package corresponding to the target type, wherein the program package is used to generate the icon to be generated on the graphical user interface; Based on the program package, at least one set of original images is obtained from the original file path, and each set of original images is converted into a corresponding target icon in the first target file path to obtain at least one target icon. The program package includes a single-layer icon package, a double-layer icon package, and a single-layer action icon package. The single-layer icon package is used to blur a blurred image superimposed with a random mask, and to superimpose the original image with the blurred image after blurring. The blurred image is obtained by blurring the original image using the random mask. The double-layer icon package is used to occlude a second original image in at least one set of original images using a mask. The mask is obtained by offsetting a first original image in at least one set of original images, with the second original image located below the first original image. The single-layer action icon package is used to generate ambient light occlusion for the original image.
2. The method of claim 1, wherein, Based on the program package, at least one set of original images is obtained from the original file path, including: Obtain the original file path that links to the input node of the program package; Obtain the at least one set of original images from the original file path.
3. The method of claim 2, wherein, Obtaining the original file path of the input node linked to the program package includes: Call the target interface to read the original file path linked to the input node.
4. The method of claim 2, wherein, Obtaining the at least one set of original images from the original file path includes: Obtain the original image whose target image size matches the program package from the original file path to obtain the at least one set of original images, wherein the target image size is obtained by adjusting the original image size of the original images.
5. The method of claim 4, wherein, Convert each set of original images into a corresponding target icon in the first target file path, including: Based on the program package, each group of original images is converted into a target icon in the first target file path with an image size equal to the original image size.
6. The method of claim 1, wherein, Convert each set of original images into a corresponding target icon in the first target file path, including: The program package is used to obtain the color information of each set of original images, and the target icon corresponding to the first target file path is generated based on the color information of each set of original images.
7. The method of claim 1, wherein, Convert each set of original images into a corresponding target icon in the first target file path, including: In response to the program package corresponding to the single-layer water mist icon type, the program package performs a blurring process on one of the original images in each group of original images based on a random mask to obtain the blurred image. The blurred image is subjected to pixel distortion processing in the program package, or the blurred image is blurred based on an original image to obtain the target icon of the single-layer water mist icon type corresponding to the first target file path.
8. The method of claim 1, wherein, Convert each set of original images into a corresponding target icon in the first target file path, including: In response to the program package corresponding to the double-layer water mist icon type, the first original image in each group of original images is offset in the program package to obtain the target mask; In the program package, the second original image in each group of original images is masked based on the target mask to obtain the target icon of the double-layer water mist icon type corresponding to the first target file path.
9. The method of claim 1, wherein, Convert each set of original images into a corresponding target icon in the first target file path, including: In response to the program package corresponding to the single-layer water mist action icon type, the light information of one of the original images in each group of original images is obtained from the program package; In the program package, a target icon of the single-layer water mist action icon type corresponding to the first target file path is generated based on the light information.
10. The method according to any one of claims 1 to 9, characterized in that, The method further includes: Based on each target icon and the corresponding set of original images, an edit file for each target icon is generated, wherein the edit file is used to edit the corresponding target icon file; Output the edited file for each target icon to the second target file path.
11. A method of generating an icon, characterized by, include: In response to a file input command applied to a graphical user interface, the original file path and the first target file path are displayed on the graphical user interface; In response to an icon output command applied to the graphical user interface, at least one target icon of a target type is output to the first target file path. The at least one target icon is obtained by acquiring at least one set of original images from the original file path based on a program package corresponding to the target type, and by converting each set of original images. The program package is used to generate an icon to be generated on the graphical user interface. The program package includes a single-layer icon package, a double-layer icon package, and a single-layer action icon package. The single-layer icon package is used to blur a blurred image superimposed with a random mask, and to superimpose the original image with the blurred image after blurring. The blurred image is obtained by blurring the original image using the random mask. The dual-layer icon package is used to mask a second original image in at least one set of original images, wherein the mask is obtained by offsetting a first original image in at least one set of original images, and the second original image is located below the first original image; the single-layer action icon package is used to generate ambient light occlusion of the original image.
12. An apparatus for generating an icon, the apparatus comprising: include: The determining unit is used to determine the target type of the icon to be generated on the graphical user interface; A calling unit is used to call a program package corresponding to the target type, wherein the program package is used to generate the icon to be generated on the graphical user interface; The processing unit is configured to obtain at least one set of original images from the original file path based on the program package, and convert each set of original images into a corresponding target icon in the first target file path to obtain at least one target icon. The program package includes a single-layer icon package, a double-layer icon package, and a single-layer action icon package. The single-layer icon package is used to blur a blurred image superimposed with a random mask, and to superimpose the original image with the blurred image after blurring. The blurred image is obtained by blurring the original image using the random mask. The double-layer icon package is used to occlude a second original image in at least one set of original images using a mask. The mask is obtained by offsetting a first original image in at least one set of original images, with the second original image located below the first original image. The single-layer action icon package is used to generate ambient light occlusion for the original image.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method described in any one of claims 1 to 11 when run by a processor. 14.An electronic device comprising a memory and a processor, the electronic device characterized by, The memory stores a computer program, and the processor is configured to run the computer program to perform the method described in any one of claims 1 to 11.