Complex color image personalized conversion method and system

Through a personalized conversion method of complex color images, the problem of incomplete conversion of complex color images in the prior art is solved, and efficient SVG vector image generation and personalized interaction functions are realized.

CN119516039AActive Publication Date: 2025-02-25JIANGXI FASHION TECH
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The prior art is difficult to effectively process complex color images such as complex and diverse lines and colors, resulting in incomplete conversion results and a lot of manual processing of details is required.

Method used

Provide a method for personalized conversion of complex color images, which is to obtain the image to be converted, preprocessed and converted into basic SVG images, and receive user-defined scripts for control and association, and output personalized SVG images.

Benefits of technology

It realizes efficient conversion of complex color images into SVG vector images, supports personalized generation and interaction functions, and the graphics quality is not lost when enlarged or changed in size. Users can adjust control points to improve interactivity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119516039A_ABST
    Figure CN119516039A_ABST
Patent Text Reader

Abstract

The invention provides a personalized conversion method and system for a complex color image, and the method comprises the steps: obtaining a to-be-converted complex color image, determining the to-be-converted complex color image through a processing tool, and setting a to-be-converted parameter; reading the to-be-converted complex color image through the reading function, and preprocessing the to-be-processed complex color image to obtain a processed image; converting the processed image into a basic SVG image through a processing tool; according to the method, the user-defined script issued by the user is received, the user-defined script and the basic SVG image are subjected to control association to output the personalized SVG image, the obtained personalized SVG image can pattern each control point, the visual effect of the image area can be adjusted, the user can adjust the control points, and the interactivity is improved.
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 in particular relates to a method and system for personalized conversion of complex color images. Background Art

[0002] Nowadays, the Internet is flooded with visual images. When people see good case pictures and want to learn from them, they need to hand-draw them from beginning to end. Simple image bitmaps can be used to identify and extract similar colors through existing technologies, but when encountering complex and diverse lines and colors, the extraction will be incomplete, and a lot of manual work is still needed to trace and fill in the gaps. For example, if you want to convert the existing enterprise map square pictures of the park into SVG vectors to adapt to the design of each promotional background or interface, you need complex bitmaps with intricate module routes and multi-color lines.

[0003] The current way to convert multi-color images into SVG images is to use design software or simple AI such as Adobe Illustrator / VTracer, which extracts line information from images by blurring and other image tracing. The disadvantage is that they cannot handle complex color graphics, and there may be situations such as missing information, and a lot 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, which are used 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, comprising: Obtain a complex color image to be converted, determine the complex color image to be converted and set parameters to be converted by 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 by the processing tool; A custom script sent by a user is received, and the custom script is controlled and associated with the basic SVG image to output a personalized SVG image.

[0006] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention can be a method for converting complex color maps into SVG vector graphics, and can also realize personalized generation of vector graphics display in SVG format, without loss of graphic quality when enlarging or changing the size, and provides a wealth of basic graphic elements, supports functions such as intersection, and the obtained personalized SVG image can adjust the visual effect of each control point of the image area, and allow users to adjust these control points to improve interactivity.

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

[0008] Preferably, the parameters to be converted include adjusting screen segmentation parameters, image minimum pixel value, and anti-aliasing number.

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

[0010] Preferably, the step of preprocessing the complex color image to be processed to obtain a processed image includes: The complex color image to be processed is subjected to binarization processing and Gaussian blur processing in sequence to obtain a processed image.

[0011] Preferably, the step of converting the processed image into a basic SVG image by the processing tool comprises: Extracting element information from the processed image using a Canny operator built into the processing tool to obtain image element information, wherein the image element information includes lines, colors, and modules of graphic objects in the image; Drawing the image contour of the processed image by means of a drawing library to obtain a processed object contour; The basic SVG image is obtained by fusing the image element information with the contour of the processing object and adjusting the image output format to the SVG format.

[0012] Preferably, the step of receiving a custom script sent by a user and controlling and 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 a user through the Javascript script engine; Adding independent control attributes to each element in the basic SVG image and configuring corresponding image element information; The user clicks are bound to 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.

[0013] In a second aspect, the present invention provides the following technical solution: a complex color image personalized conversion system, the system comprising: An acquisition module is used to acquire a complex color image to be converted, determine the complex color image to be converted through a processing tool, and set parameters to be converted; A processing module, used for 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; A conversion module, used for converting the processed image into a basic SVG image by the processing tool; The personalization module is used to receive a custom script sent by a user, and control and associate the custom script with the basic SVG image to output a personalized SVG image.

[0014] In a third aspect, the present invention provides the following technical solution: a computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the complex color image personalized conversion method as described above when executing the computer program.

[0015] In a fourth aspect, the present invention provides the following technical solution: a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the complex color image personalized conversion method as described above. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 A flowchart of a method for personalized conversion of complex color images provided in Embodiment 1 of the present invention; Figure 2 A structural block diagram of a complex color image personalized conversion system provided in Embodiment 2 of the present invention; Figure 3 A schematic diagram of the hardware structure of a computer provided in another embodiment of the present invention.

[0018] The embodiments of the present invention will be further described below with reference to the accompanying drawings. DETAILED DESCRIPTION

[0019] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the embodiments of the present invention, and should not be construed as limiting the present invention.

[0020] Embodiment 1 In the first embodiment of the present invention, Figure 1 As shown, a complex color image personalized conversion method includes: S1. Obtain a complex color image to be converted, determine the complex color image to be converted and set parameters to be converted by a processing tool; Specifically, the processing tool is a VECTOR configuration tool, which can confirm, read, preprocess and convert images. The parameters to be converted include adjusting screen segmentation parameters, image minimum pixel value, and anti-aliasing number.

[0021] S2, 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; The reading function is cv2.imread(...) function, which is a built-in reading function in OpenCV, and can be used to read a bitmap file and perform a preprocessing process on the image.

[0022] Specifically, the step of preprocessing the complex color image to be processed to obtain a processed image includes: The complex color image to be processed is subjected to binarization processing and Gaussian blur processing in sequence to obtain a processed image.

[0023] S3, converting the processed image into a basic SVG image by the processing tool; Wherein, the step S3 comprises: S31. Extracting element information of the processed image by using the Canny operator built into the processing tool to obtain image element information, wherein the image element information includes lines, colors, and modules of graphic objects in the image.

[0024] S32, drawing the image contour of the processed image through a drawing library to obtain a processed object contour; Specifically, the drawing library here is a Python drawing library, such as matplotlib.

[0025] S33, fusing the image element information with the contour of the processing object, and adjusting the image output format to the SVG format, so as to obtain a basic SVG image; Specifically, after obtaining the image element information and the contour of the processing object, the two are fused and the parameters to be converted are obtained in step S1, and finally the image output format is set to 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 processing image.

[0026] S4, receiving a custom script sent by a user, and controlling and associating the custom script with the basic SVG image to output a personalized SVG image; Wherein, the step S4 comprises: S41, embedding the basic SVG image into a Javascript script engine, and receiving a custom script written by a user through the Javascript script engine; Specifically, the basic SVG image is embedded in the Javascript script engine, and the corresponding tags are obtained by directly accessing the color, line, text and other elements in the basic SVG image. By modifying these internal elements, users can freely configure them to adapt to more user scenarios. At the same time, users can write custom scripts through the integrated Javascript script engine to modify the properties 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 properties of SVG elements, such as color, size, position, etc. The property panel is interconnected with the Javascript script engine. Users can automatically generate corresponding Javascript code after modifying the properties in the panel, or directly modify the properties in the script and view the effect in real time.

[0027] S42, adding independent control attributes to each element in the basic SVG image and configuring corresponding image element information; Specifically, the corresponding image element information here specifically refers to elements such as color, line, text, etc. in the basic SVG image.

[0028] S43, implementing and obtaining the image element information of the basic SVG image by binding the user click through the custom script to perform interactive response control, so as to output a personalized SVG image; Specifically, the personalized SVG image obtained through the above steps can adjust the visual effect of the image area according to each control point, and allow users to adjust these control points to improve interactivity.

[0029] The first embodiment of the present invention provides a personalized conversion method for complex color images, which can convert complex color images into SVG vector images, and can also realize personalized generation of vector images in SVG format for display. The graphics quality will not be lost when enlarged or resized, and it provides a wealth of basic graphics elements and supports functions such as intersection. The obtained personalized SVG image can adjust the visual effect of the image area by arranging each control point, and allows users to adjust these control points to improve interactivity.

[0030] Embodiment 2 like Figure 2 As shown, in the second embodiment of the present invention, a complex color image personalized conversion system is provided, and the system includes: An acquisition module 1 is used to acquire a complex color image to be converted, determine the complex color image to be converted through a processing tool and set parameters to be converted; Processing module 2, used for 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; A conversion module 3, used for converting the processed image into a basic SVG image through the processing tool; The personalization module 4 is used to receive a custom script sent by a user, and control and associate the custom script with the basic SVG image to output a personalized SVG image.

[0031] Wherein, the conversion module 3 includes: An extraction submodule, used to extract element information of the processed image by using the Canny operator built into the processing tool to obtain image element information, wherein the image element information includes lines, colors, and modules of graphic objects in the image; A drawing submodule, used for drawing the image contour of the processed image through a drawing library to obtain a processed object contour; The fusion submodule is used to obtain a basic SVG image by fusing the image element information with the contour of the processing object and adjusting the image output format to the SVG format.

[0032] The personalization module 4 includes: An embedding submodule, used for embedding the basic SVG image into a Javascript script engine, and receiving a custom script written by a user through the Javascript script engine; An attribute control submodule, used to add independent control attributes to each element in the basic SVG image and configure corresponding image element information; The interactive submodule is used to implement and obtain the image element information of the basic SVG image by binding the user click through the custom script to perform interactive response control so as to output a personalized SVG image.

[0033] In some other embodiments of the present invention, the embodiments of the present invention provide the following technical solution: a computer, comprising a memory 102, a processor 101, and a computer program stored in the memory 102 and executable on the processor 101, wherein the processor 101 implements the complex color image personalized conversion method as described above when executing the computer program.

[0034] Specifically, the processor 101 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present invention.

[0035] Among them, the memory 102 may include a large-capacity memory 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 disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 102 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 102 may be inside or outside the data processing device. In a specific embodiment, the memory 102 is a non-volatile memory. In a specific embodiment, the memory 102 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, 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 (FLASH), or a combination of two or more of these. Under appropriate circumstances, the RAM can be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM can 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.

[0036] The memory 102 may be used to store or cache various data files that need to be processed and / or used for communication, as well as possible computer program instructions executed by the processor 101 .

[0037] The processor 101 implements the above-mentioned complex color image personalized conversion method by reading and executing the computer program instructions stored in the memory 102 .

[0038] In some embodiments, the computer may further include a communication interface 103 and a bus 100. Figure 3 As shown, the processor 101, the memory 102, and the communication interface 103 are connected via a bus 100 and communicate with each other.

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

[0040] The bus 100 includes hardware, software or both, and couples the components of the computer device to each other. The bus 100 includes but is not limited to at least one of the following: a data bus, an address bus, a control bus, an expansion bus, and a 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 buses or a combination of two or more of these. Where appropriate, bus 100 may include one or more buses. Although embodiments of the present invention describe and illustrate a particular bus, the present invention contemplates any suitable bus or interconnect.

[0041] The computer can execute the complex color image personalized conversion method of the present invention based on the acquired complex color image personalized conversion system, thereby realizing the complex color image personalized conversion method.

[0042] In some further embodiments of the present invention, in combination with the above-mentioned complex color image personalized conversion method, the embodiments of the present invention provide the following technical solutions, a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned complex color image personalized conversion method is implemented.

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

[0044] More specific examples of readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0045] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned 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, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0046] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0047] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A personalized conversion method for complex color images, characterized in that: include: Obtain a complex color image to be converted, determine the complex color image to be converted and set parameters to be converted by 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 by the processing tool; A custom script sent by a user is received, and the custom script is controlled and associated with the basic SVG image to output a personalized SVG image.

2. The complex color image personalized conversion method according to claim 1, characterized in that: The processing tool is a VECTOR configuration tool.

3. The complex color image personalized conversion method according to claim 1, characterized in that: The parameters to be converted include adjustment of screen segmentation parameters, image minimum pixel value, and anti-aliasing number.

4. The complex color image personalized conversion method according to claim 1, characterized in that: The reading function is cv2.imread(...) function.

5. The complex color image personalized conversion method according to claim 1, characterized in that: The step of preprocessing the complex color image to be processed to obtain a processed image comprises: The complex color image to be processed is subjected to binarization processing and Gaussian blur processing in sequence to obtain a processed image.

6. The complex color image personalized conversion method according to claim 1, characterized in that: The step of converting the processed image into a basic SVG image by the processing tool comprises: Extracting element information from the processed image using a Canny operator built into the processing tool to obtain image element information, wherein the image element information includes lines, colors, and modules of graphic objects in the image; Drawing the image contour of the processed image by means of a drawing library to obtain a processed object contour; The basic SVG image is obtained by fusing the image element information with the contour of the processing object and adjusting the image output format to the SVG format.

7. The complex color image personalized conversion method according to claim 1, characterized in that: The step of receiving a custom script sent by a user and controlling and 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 a user through the Javascript script engine; Adding independent control attributes to each element in the basic SVG image and configuring corresponding image element information; The user clicks are bound to 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.

8. A complex color image personalized conversion system, characterized in that: The system comprises: An acquisition module is used to acquire a complex color image to be converted, determine the complex color image to be converted through a processing tool, and set parameters to be converted; A processing module, used for 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; A conversion module, used for converting the processed image into a basic SVG image by the processing tool; The personalization module is used to receive a custom script sent by a user, and control and associate the custom script with the basic SVG image to output a personalized SVG image.

9. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for personalized conversion of complex color images as described in any one of claims 1 to 7 is implemented.

10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method for personalized conversion of complex color images as claimed in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Preparation method of network statistical map visualized data

    CN104408137A

  • Image color filling method and device

    CN107918944A

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

    CN109636887A

  • Method and device for modifying color of svg image, equipment and storage medium

    CN116680489A

  • Image drawing method and related device

    CN118537421A