A Method and System for Personalized Conversion of Complex Color Images

Through processing tools and user-defined scripts, personalized SVG images are generated, which solves the problem of missing information when converting complex color graphics into SVG images, and realizes efficient conversion and interactive adjustment.

CN119516039BActive Publication Date: 2025-07-22JIANGXI FASHION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411526439.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-07-22
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

The prior art is difficult to effectively process the conversion of complex multi-color line graphics into SVG images, resulting in missing information and requiring a lot of manual processing of details.

Method used

By obtaining complex color images, setting parameters using processing tools, preprocessing and converting them into basic SVG images, and receiving user-defined scripts for control associations to generate personalized SVG images.

Benefits of technology

It realizes efficient conversion of complex color images to SVG images, supports interactive adjustment, no loss of graphics quality, and users can customize visual effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119516039B_ABST
    Figure CN119516039B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for personalized conversion of complex color images. The method includes obtaining a complex color picture to be converted, determining and setting parameters to be converted for the complex color image to be converted through a processing tool; reading the complex color image to be converted through a reading function and preprocessing the complex color image to be processed to obtain a processed image; converting the processed image into a basic SVG image through a processing tool; receiving a custom script issued by a user, and performing control association between the custom script and the basic SVG image to output a personalized SVG image. The personalized SVG image obtained by the present invention can adjust the visual effect of the image area according to each control point, and can allow the user to adjust these control points, improving the interactivity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image processing, and particularly relates to a method and system for personalized conversion of complex color images. Background Art

[0002] Nowadays, visual pictures are flooding the Internet. When people see good example pictures and want to draw them by hand from beginning to end for reference. Simple picture bitmaps can identify and extract similar colors through existing technologies. However, when encountering complex and diverse lines, colors, etc., the extraction will be incomplete, and a large amount of manual tracing and checking for omissions are still required. For example, when trying to convert the existing enterprise map block pictures of a park into SVG vectors to adapt to the design of each promotional background or interface, it is a complex bitmap with multi-color lines such as intricate module routes.

[0003] In the market, when processing the conversion of multi-color pictures into SVG pictures, currently, design software or simple AI such as Adobe Illustrator / VTracer is used. They extract the line information of the pictures through image tracing such as blurring. The disadvantage is that they cannot process complex color graphics, and there will be situations such as missing information and a large amount of manual processing of details is required. Summary of the Invention

[0004] In order to solve the above technical problems, the present invention provides a method and system for personalized conversion of complex color images to solve the technical problems in the prior art.

[0005] On the one hand, the present invention provides the following technical solution. A method for personalized conversion of complex color images includes:

[0006] Obtain a complex color picture to be converted, and determine and set the parameters to be converted for the complex color image to be converted through a processing tool;

[0007] Read the complex color image to be converted through a reading function and preprocess the complex color image to be processed to obtain a processed image;

[0008] Convert the processed image into a basic SVG image through the processing tool;

[0009] Receive a custom script issued by the user, and perform control association between the custom script and the basic SVG image to output a personalized SVG image.

[0010] Compared with the prior art, the beneficial effects of the present invention are as follows: The method of the present invention can convert a complex color map into an SVG vector map, and at the same time can realize the personalized generation of vector map display in SVG format. Its graphic quality will not be lost when enlarged or the size is changed, and it provides rich basic graphic elements and supports functions such as intersection. The obtained personalized SVG image can adjust the visual effect of the image area according to each control point, and the user can adjust these control points to improve the interactivity.

[0011] Preferably, the processing tool is a VECTOR configuration tool.

[0012] Preferably, the parameters to be converted include screen splitting adjustment parameters, minimum pixel value of the image, and number of anti-aliasing.

[0013] Preferably, the reading function is the cv2.imread(…) function.

[0014] Preferably, the step of preprocessing the complex color image to be processed to obtain a processed image includes:

[0015] Performing binaryzation processing and Gaussian blur processing on the complex color image to be processed in sequence to obtain a processed image.

[0016] Preferably, the step of converting the processed image into a basic SVG image by the processing tool includes:

[0017] Extracting element information from the processed image by using the Canny operator built in the processing tool to obtain image element information, where the image element information includes the lines, colors, and modules of graphic objects in the image;

[0018] Drawing the image contour of the processed image by using a drawing library to obtain a processed object contour;

[0019] Performing fusion processing on the image element information and the processed object contour, and adjusting the image output format to SVG format to obtain a basic SVG image.

[0020] Preferably, the step of receiving a custom script issued by the user, associating the custom script with the basic SVG image for control, and outputting a personalized SVG image includes:

[0021] Embedding the basic SVG image into a Javascript script engine and receiving a custom script written by the user through the Javascript script engine;

[0022] Adding independent control attributes to each element in the basic SVG image and configuring corresponding image element information;

[0023] Implement and obtain the image element information of the basic SVG image through the binding of the user click by the custom script for interactive response control, so as to output a personalized SVG image.

[0024] In a second aspect, the present invention provides the following technical solution. A complex color image personalized conversion system, the system includes:

[0025] An acquisition module, configured to acquire a complex color picture to be converted, and determine and set conversion parameters for the complex color image to be converted through a processing tool;

[0026] A processing module, configured to read the complex color image to be converted through a reading function and preprocess the complex color image to be processed to obtain a processed image;

[0027] A conversion module, configured to convert the processed image into a basic SVG image through the processing tool;

[0028] A personalization module, configured to receive a custom script issued by a user, and control and associate the custom script with the basic SVG image to output a personalized SVG image.

[0029] In a third aspect, the present invention provides the following technical solution. A computer includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the complex color image personalized conversion method as described above is implemented.

[0030] In a fourth aspect, the present invention provides the following technical solution. A storage medium stores a computer program, and when the computer program is executed by a processor, the complex color image personalized conversion method as described above is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0032] Figure 1 It is a flowchart of the complex color image personalized conversion method provided in Embodiment 1 of the present invention;

[0033] Figure 2 It is a structural block diagram of the complex color image personalized conversion system provided in Embodiment 2 of the present invention;

[0034] Figure 3Schematic diagram of the hardware structure of a computer provided by another embodiment of the present invention.

[0035] The embodiments of the present invention will be further described below with reference to the accompanying drawings. Specific embodiments

[0036] The embodiments of the present invention will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to explain the embodiments of the present invention and should not be construed as limiting the present invention.

[0037] Embodiment 1

[0038] In Embodiment 1 of the present invention, as Figure 1 shown, a method for personalized conversion of complex color images includes:

[0039] S1. Obtain a complex color picture to be converted, and determine and set conversion parameters for the complex color image to be converted through a processing tool;

[0040] Specifically, the processing tool is a VECTOR configuration tool, which can confirm, read, preprocess, and convert images. The conversion parameters to be set include screen segmentation parameters, minimum pixel value of the image, and anti-aliasing number.

[0041] S2. Read the complex color image to be converted through a reading function and preprocess the complex color image to be processed to obtain a processed image;

[0042] Among them, the reading function is the cv2.imread(…) function, which is a built-in reading function in OpenCV and can be used to read bitmap files and preprocess images.

[0043] Specifically, the step of preprocessing the complex color image to be processed to obtain a processed image includes:

[0044] Perform binaryzation processing and Gaussian blur processing on the complex color image to be processed in sequence to obtain a processed image.

[0045] S3. Convert the processed image into a basic SVG image through the processing tool;

[0046] Among them, step S3 includes:

[0047] S31. Extract the element information of the processed image through the Canny operator built in the processing tool to obtain the image element information, where the image element information includes the lines, colors, and modules of the graphic objects in the image.

[0048] S32. Draw the image contour of the processed image through a drawing library to obtain the processed object contour;

[0049] Specifically, the drawing library here is specifically the drawing library of Python, such as matplotlib.

[0050] S33. Perform a fusion process on the image element information and the processed object contour, and adjust the image output format to the SVG format to obtain a basic SVG image;

[0051] Specifically, after obtaining the image element information and the processed object contour, fuse the two, and use the parameter to be converted obtained in step S1. Finally, set the image output format to the SVG format to obtain a basic SVG image. The basic SVG image contains basic image elements, such as paths, rectangles, etc. These image elements roughly correspond to the shapes and colors of the graphic objects in the processed image.

[0052] S4. Receive the custom script issued by the user, and perform a control association between the custom script and the basic SVG image to output a personalized SVG image;

[0053] Among them, step S4 includes:

[0054] S41. Embed the basic SVG image into the Javascript script engine, and receive the custom script written by the user through the Javascript script engine;

[0055] Specifically, embed the basic SVG image into the Javascript script engine. By directly accessing the elements such as colors, lines, and texts in the basic SVG image, obtain the corresponding tags, and modify these internal elements so that users can freely configure them to adapt to more user scenarios;

[0056] At the same time, users can write custom scripts through the integrated Javascript script engine to modify the attributes of SVG elements, add animation effects or implement other complex functions. At the same time, users can use the property panel to visually edit the attributes of SVG elements, such as colors, sizes, positions, etc. The property panel is associated with the Javascript script engine. Users can automatically generate the corresponding Javascript code after modifying the attributes in the panel, or directly modify the attributes in the script and view the effects in real time.

[0057] S42. Add independent control attributes to each element in the basic SVG image and configure the corresponding image element information;

[0058] Specifically, the corresponding image element information here specifically refers to elements such as colors, lines, and texts in the basic SVG image.

[0059] S43. Bind user clicks through the custom script to implement and obtain the image element information of the basic SVG image for interactive response control, so as to output a personalized SVG image;

[0060] Specifically, the personalized SVG image obtained through the above steps can adjust the visual effects of the image area according to each control point, and allow users to adjust these control points to improve interactivity.

[0061] The complex color image personalized conversion method provided in Embodiment 1 of the present invention can convert a complex color image into an SVG vector image, and at the same time can realize the personalized generation and display of SVG format vector images. Its graphic quality will not be lost when enlarged or changed in size, and it provides rich basic graphic elements and supports functions such as interaction. The obtained personalized SVG image can adjust the visual effects of the image area according to each control point, and allow users to adjust these control points to improve interactivity.

[0062] Embodiment 2

[0063] As Figure 2 shown, Embodiment 2 of the present invention provides a complex color image personalized conversion system, and the system includes:

[0064] An acquisition module 1, configured to acquire a complex color picture to be converted, and determine and set conversion parameters for the complex color image to be converted through a processing tool;

[0065] A processing module 2, configured to read the complex color image to be converted through a reading function and preprocess the complex color image to be processed to obtain a processed image;

[0066] A conversion module 3, configured to convert the processed image into a basic SVG image through the processing tool;

[0067] A personalization module 4, configured to receive a custom script issued by a user, and control-associate the custom script with the basic SVG image to output a personalized SVG image.

[0068] Wherein, the conversion module 3 includes:

[0069] An extraction sub-module, configured to extract element information from the processed image through the Canny operator built in the processing tool to obtain image element information, where the image element information includes the lines, colors, and modules of graphic objects in the image;

[0070] A drawing sub-module, configured to draw the image contour of the processed image through a drawing library to obtain a processed object contour;

[0071] A fusion sub-module, configured to perform a fusion process on the image element information and the processed object contour, and adjust the image output format to the SVG format to obtain a basic SVG image.

[0072] The personalization module 4 includes:

[0073] An embedding sub-module, configured to embed the basic SVG image into a Javascript script engine and receive a custom script written by a user through the Javascript script engine;

[0074] An attribute control sub-module, configured to add independent control attributes to each element in the basic SVG image and configure corresponding image element information;

[0075] An interaction sub-module, configured to bind user clicks through the custom script, implement and obtain the image element information of the basic SVG image for interactive response control to output a personalized SVG image.

[0076] In some other embodiments of the present invention, the embodiments of the present invention provide the following technical solution. A computer includes a memory 102, a processor 101, and a computer program stored on the memory 102 and executable on the processor 101. When the processor 101 executes the computer program, the complex color image personalization conversion method described above is implemented.

[0077] Specifically, the above-mentioned processor 101 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured as one or more integrated circuits implementing the embodiments of the present invention.

[0078] Among them, the memory 102 may include a mass storage for data or instructions. By way of example and not limitation, the memory 102 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disc, a magneto-optical disc, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In appropriate cases, the memory 102 may include removable or non-removable (or fixed) media. In appropriate cases, the memory 102 may be internal or external to the data processing device. In a particular embodiment, the memory 102 is non-volatile memory. In a particular embodiment, the memory 102 includes a read-only memory (ROM) and a random access memory (RAM). In appropriate cases, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM), or a flash memory, or a combination of two or more of these. In appropriate cases, the RAM may be a static random access memory (SRAM) or a dynamic random access memory (DRAM), where the DRAM may be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.

[0079] The memory 102 can be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 101.

[0080] The processor 101 reads and executes the computer program instructions stored in the memory 102 to implement the above-mentioned complex color image personalized conversion method.

[0081] In some of these embodiments, the computer may further include a communication interface 103 and a bus 100. Among them, as Figure 3 shown, the processor 101, the memory 102, and the communication interface 103 are connected through the bus 100 and complete communication with each other.

[0082] The communication interface 103 is used to implement communication between the various modules, devices, units, and / or devices in the embodiments of the present invention. The communication interface 103 can also implement data communication with other components such as external devices, image / data acquisition devices, databases, external storage, and image / data processing workstations.

[0083] Bus 100 includes hardware, software, or both, and couples components of a computer device together. Bus 100 includes, but is not limited to, at least one of the following: Data Bus, Address Bus, Control Bus, Expansion Bus, Local Bus. By way of example and not limitation, Bus 100 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a Memory Bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable bus or a combination of two or more of these. In suitable cases, Bus 100 may include one or more buses. Although embodiments of the present invention describe and illustrate specific buses, the present invention contemplates any suitable bus or interconnect.

[0084] The computer may execute the complex color image personalized conversion method of the present invention based on the obtained complex color image personalized conversion system, thereby implementing the complex color image personalized conversion method.

[0085] In still some other embodiments of the present invention, in combination with the above complex color image personalized conversion method, embodiments of the present invention provide the following technical solution: a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the above complex color image personalized conversion method is implemented.

[0086] Those skilled in the art will understand that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a definite sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus or device), or used in combination with these instruction execution systems, apparatus or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate or transport a program for use by or in connection with an instruction execution system, apparatus or device.

[0087] More specific examples (non-exhaustive list) of the readable medium include the following: an electrical connection part with one or more wirings (electronic device), a portable computer disk cartridge (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation or other appropriate processing as necessary, and then stored in a computer memory.

[0088] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits with logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits with appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.

[0089] The technical features of the above-described embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0090] The above-described embodiments merely represent several implementation manners of the present invention. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several variations and improvements can still be made, and these all fall within the protection scope of the present invention. Therefore, the protection scope of the present invention patent shall be subject to the appended claims.

Claims

1. A personalized conversion method for complex color images, characterized in that, Including: Obtain a complex color image to be converted, and determine and set conversion parameters for the complex color image to be converted through a processing tool; Read the complex color image to be converted through a reading function and preprocess the complex color image to be processed to obtain a processed image; Convert the processed image into a basic SVG image through the processing tool; Receive a custom script issued by the user, and control-associate the custom script with the basic SVG image to output a personalized SVG image; The step of receiving a custom script issued by the user, and control-associating the custom script with the basic SVG image to output a personalized SVG image includes: Embed the basic SVG image into a Javascript script engine, and receive a custom script written by the user through the Javascript script engine; Add independent control attributes to each element in the basic SVG image and configure corresponding image element information; Bind user clicks through the custom script to implement and obtain the image element information of the basic SVG image for interactive response control to output a personalized SVG image.

2. The personalized conversion method for complex color images according to claim 1, wherein The processing tool is a VECTOR configuration tool.

3. The personalized conversion method for complex color images according to claim 1, characterized in that, The conversion parameters include screen splitting parameter adjustment, minimum pixel value of the image, and anti-aliasing number.

4. The personalized conversion method for complex color images according to claim 1, characterized in that The reading function is the cv2.imread(…) function.

5. The personalized conversion method for complex color images according to claim 1, characterized in that The step of preprocessing the complex color image to be processed to obtain a processed image includes: Perform binary processing and Gaussian blur processing on the complex color image to be processed in sequence to obtain a processed image.

6. The personalized conversion method for complex color images according to claim 1, wherein The step of converting the processed image into a basic SVG image through the processing tool includes: Extract element information from the processed image through the Canny operator built in the processing tool to obtain image element information, where the image element information includes the lines, colors, and modules of graphic objects in the image; Draw the image contour of the processed image through a drawing library to obtain a processed object contour; Perform a fusion process on the image element information and the processed object contour, and adjust the image output format to the SVG format to obtain a basic SVG image.

7. A personalized conversion system for complex color images, the system adopting the personalized conversion method for complex color images as described in claim 1, characterized in that, The system includes: An acquisition module, configured to obtain a complex color image to be converted, and determine and set conversion parameters for the complex color image to be converted through a processing tool; A processing module, configured to read the complex color image to be converted through a reading function and preprocess the complex color image to be processed to obtain a processed image; A conversion module, configured to convert the processed image into a basic SVG image through the processing tool; A personalization module, configured to receive a custom script issued by the user, and control-associate the custom script with the basic SVG image to output a personalized SVG image.

8. A computer, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the complex color image personalization conversion method according to any one of claims 1 to 6.

9. A storage medium, characterized in that, A computer program is stored on the storage medium, and when the computer program is executed by a processor, it implements the complex color image personalized conversion method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Preparation method of network statistical map visualized data

    CN104408137A

  • Two-dimensional electronic technical drawing format conversion and vectorization interaction system

    CN109636887A