CN111178013B - Method and terminal for restoring custom coloring effect of picture in PPT - Google Patents

Method and terminal for restoring custom coloring effect of picture in PPT Download PDF

Info

Publication number
CN111178013B
CN111178013B CN201911413319.6A CN201911413319A CN111178013B CN 111178013 B CN111178013 B CN 111178013B CN 201911413319 A CN201911413319 A CN 201911413319A CN 111178013 B CN111178013 B CN 111178013B
Authority
CN
China
Prior art keywords
picture
coloring effect
color value
custom
resource
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911413319.6A
Other languages
Chinese (zh)
Other versions
CN111178013A (en
Inventor
刘德建
林严
郭玉湖
陈宏�
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Tianquan Educational Technology Ltd
Original Assignee
Fujian Tianquan Educational Technology Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Tianquan Educational Technology Ltd filed Critical Fujian Tianquan Educational Technology Ltd
Priority to CN201911413319.6A priority Critical patent/CN111178013B/en
Publication of CN111178013A publication Critical patent/CN111178013A/en
Application granted granted Critical
Publication of CN111178013B publication Critical patent/CN111178013B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • H03M7/70Type of the data to be coded, other than image and sound
    • H03M7/707Structured documents, e.g. XML

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

The invention discloses a method and a terminal for restoring a picture custom coloring effect in PPT, which read an XML file in a PPTX compression format file; traversing the node content under the XML file, and determining the picture with the customized coloring effect; analyzing the node content corresponding to the picture with the customized coloring effect to obtain the color value of the customized coloring effect and picture resources; according to the color value of the custom coloring effect, a preset image processing algorithm is utilized to restore the custom coloring effect of the picture resource, and the color value of the custom coloring effect corresponding to the picture is obtained by analyzing the node content under the XML file, so that the image processing algorithm can achieve the aim of simulating PowerPoint according to the color value of the custom coloring effect and accurately restoring the picture resource.

Description

Method and terminal for restoring custom coloring effect of picture in PPT
Technical Field
The invention relates to the field of image processing, in particular to a method and a terminal for restoring a picture custom coloring effect in PPT.
Background
The custom recoloring function in PowerPoint can conveniently and quickly change the color of the picture according to the needs of the user. However, in order to copy the customized recoloring effect in PowerPoint, currently, a PPTX file is directly opened in PowerPoint, a target coloring picture to be analyzed is subjected to double-click on the picture, the color selected and processed by the target coloring picture is checked in a recoloring option under a format menu bar, then the PPTX file is changed into a compressed format, an original picture of the target coloring picture in the PPTX file is obtained after decompression and is imported into a PS, the color balance of an image layer in the PS is adjusted to be the same as the color effect of the target coloring picture according to the color set in recoloring the picture checked in PowerPoint, however, the adjustment of the color balance in the PS needs to change the red, green and blue color setting values of the image layer, and the color selected by the checked target coloring picture is processed to be a single color value, which makes the PS unable to completely and accurately simulate the customized recoloring effect in PowerPoint.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the method and the terminal for restoring the picture custom coloring effect in the PPT can accurately analyze the picture custom coloring effect parameters in the PPTX file and restore the effect of the original picture.
In order to solve the technical problems, the invention adopts the technical scheme that:
a method for restoring a picture custom coloring effect in PPT comprises the following steps:
s1, reading an XML file under a PPTX compression format file;
s2, traversing the node content under the XML file, and determining the picture with the customized coloring effect;
s3, analyzing the node content corresponding to the picture with the customized coloring effect, and acquiring the color value and the picture resource of the customized coloring effect;
and S4, carrying out custom coloring effect restoration on the picture resource by utilizing a preset image processing algorithm according to the color value of the custom coloring effect.
In order to solve the technical problem, the invention adopts another technical scheme as follows:
a terminal for restoring a picture custom coloring effect in PPT comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the computer program to realize the following steps:
s1, reading an XML file under a PPTX compression format file;
s2, traversing the node content under the XML file, and determining the picture with the customized coloring effect;
s3, analyzing the node content corresponding to the picture with the customized coloring effect, and acquiring the color value and the picture resource of the customized coloring effect;
and S4, carrying out self-defined coloring effect restoration on the picture resource by utilizing a preset image processing algorithm according to the color value of the self-defined coloring effect.
The invention has the beneficial effects that: traversing node contents in an XML file under a PPTX compression format file, determining a picture with a custom coloring effect, acquiring a custom coloring effect color value corresponding to the picture and a picture resource thereof, and performing custom coloring effect restoration on the picture resource by using a preset image processing algorithm according to the color value. Because the XML file in the PPTX compression format file contains the marker symbols used for describing element information in the PPT page, the picture which is subjected to the custom coloring effect in the PPTX file can be effectively positioned by analyzing the node content in the XML file, and the color value of the custom coloring effect corresponding to the picture can be accurately obtained, so that the image processing algorithm can achieve the purpose of simulating PowerPoint according to the color value and accurately restoring the picture resource, and the problem that the custom re-coloring effect in PowerPoint is difficult to copy by using PS in the prior art is effectively solved.
Drawings
Fig. 1 is a flowchart of steps of a method for restoring a custom coloring effect of a picture in PPT according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a terminal for restoring a custom coloring effect of a picture in PPT according to an embodiment of the present invention;
description of reference numerals:
1. a terminal for restoring the picture custom coloring effect in PPT; 2. a memory; 3. a processor.
Detailed Description
In order to explain technical contents, achieved objects, and effects of the present invention in detail, the following description is made with reference to the accompanying drawings in combination with the embodiments.
Referring to fig. 1, a method for restoring a custom coloring effect of a picture in PPT includes the steps of:
s1, reading an XML file under a PPTX compression format file;
s2, traversing the node content under the XML file, and determining the picture with the customized coloring effect;
s3, analyzing the node content corresponding to the picture with the customized coloring effect to obtain the color value of the customized coloring effect and picture resources;
and S4, carrying out self-defined coloring effect restoration on the picture resource by utilizing a preset image processing algorithm according to the color value of the self-defined coloring effect.
From the above description, the beneficial effects of the present invention are: traversing node contents in an XML file under a PPTX compression format file, determining a picture with a customized coloring effect, acquiring a customized coloring effect color value corresponding to the picture and a picture resource thereof, and performing customized coloring effect restoration on the picture resource by using a preset image processing algorithm according to the color value. Because the XML file in the PPTX compressed format file contains the mark symbol used for describing element information in the PPT page, the picture with the customized coloring effect in the PPTX file can be effectively positioned by analyzing the node content in the XML file, and the color value of the customized coloring effect corresponding to the picture can be accurately obtained, so that the image processing algorithm can achieve the purposes of simulating PowerPoint and accurately restoring picture resources according to the color value, and the problem that the customized recoloring effect in PowerPoint is difficult to copy by using PS in the prior art is effectively solved.
Further, the step S2 includes:
acquiring all files representing PPT page content under the XML file, traversing picture nodes under the files, judging whether nodes for identifying the custom coloring effect exist under the picture nodes, if so, executing the step S3, and if not, not processing.
According to the description, when the picture passes through the custom coloring effect, the original tone of the picture can be changed, so that the node which represents the color value of the picture to be changed can exist under the picture node as the identifier of the custom coloring effect, whether the identifier node exists under the picture node or not is judged, the picture passing through the custom coloring effect can be rapidly determined, and the efficiency of analyzing the content of the node is improved.
Further, the step S3 includes:
s31, analyzing the node content for identifying the custom coloring effect, acquiring a custom coloring effect color value of the picture and a unique identifier of the picture, and storing the custom coloring effect color value and the unique identifier of the picture in an array in a JSON data format;
s32, traversing all the unique identifiers stored in the array, and respectively executing the following steps for each unique identifier:
s321, matching a relative path of the corresponding picture resource in the page resource associated file according to the unique identifier, acquiring the picture resource by using the relative path, and storing the picture resource in a project directory in a file form;
s322, establishing a corresponding relation between the self-defined coloring effect color value corresponding to the unique identifier of the picture and the picture resource.
According to the description, the customized recoloring function in the PowerPoint can conveniently and quickly change the color of the picture according to the user needs, so that the preset color value of the picture when the customized recoloring is performed is obtained, and the purpose of accurately simulating the customized recoloring effect in the PowerPoint can be achieved according to the color value, the problem that the customized recoloring effect in the PowerPoint is difficult to copy by using a PS (packet switch) in the traditional method is effectively solved, meanwhile, the picture resource is obtained through the unique identifier of the picture, the corresponding relation between the customized recoloring effect color value corresponding to the picture resource and the picture resource is established according to the unique identifier of the picture, the subsequent processing of the corresponding customized recoloring effect on the picture resource can be ensured in a targeted manner, the accuracy of the picture effect reduction process is further ensured, in addition, data are saved through a JSON array, data transmission is facilitated, and redundant characters are reduced.
Further, the step S4 includes:
traversing all the picture resources stored in the project directory, and respectively executing the following steps on each picture resource:
acquiring a JSON array for storing the color value of the custom coloring effect according to the corresponding relation between the picture resource and the color value of the custom coloring effect, reading the corresponding color value of the custom coloring effect by using the JSON array, transmitting the color value of the custom coloring effect to a preset image processing algorithm, and restoring the custom coloring effect to the picture resource by using the image processing algorithm.
According to the description, the user-defined coloring effect color values stored in the transferred JSON array are directly acquired through the corresponding relation between the picture resources and the user-defined coloring effect color values, the efficiency of the reduction process is improved, the picture resources are processed by using the image processing algorithm with the picture user-defined coloring effect color values, the pictures are reduced strictly according to transferred color value parameters, and the purpose of one-to-one effect copying is achieved.
Further, the step S4 of restoring the custom coloring effect of the picture resource by using the image processing algorithm includes:
traversing all pixels of the picture resource, and respectively executing for each pixel:
and obtaining the color value of the pixel, calculating the color value of the pixel of the picture after the processing of the custom coloring effect according to the transferred custom coloring effect color value, and reassigning the color value of the pixel according to the calculation result.
As can be seen from the above description, the pixels are basic primitive elements and basic codes of gray levels thereof, and are basic units constituting the picture, so that the color values of each pixel unit in the picture are reassigned according to the transmitted color value parameters of the customized coloring effect by using a preset image processing algorithm, and the overall effect of picture restoration can be effectively guaranteed.
Referring to fig. 2, a terminal for restoring a custom coloring effect of a picture in a PPT includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the following steps:
s1, reading an XML file under a PPTX compression format file;
s2, traversing the node content under the XML file, and determining the picture with the customized coloring effect;
s3, analyzing the node content corresponding to the picture with the customized coloring effect, and acquiring the color value and the picture resource of the customized coloring effect;
and S4, carrying out custom coloring effect restoration on the picture resource by utilizing a preset image processing algorithm according to the color value of the custom coloring effect.
From the above description, the beneficial effects of the present invention are: traversing node contents in an XML file under a PPTX compression format file, determining a picture with a customized coloring effect, acquiring a customized coloring effect color value corresponding to the picture and a picture resource thereof, and performing customized coloring effect restoration on the picture resource by using a preset image processing algorithm according to the color value. Because the XML file in the PPTX compression format file contains the marker symbols used for describing element information in the PPT page, the picture which is subjected to the custom coloring effect in the PPTX file can be effectively positioned by analyzing the node content in the XML file, and the color value of the custom coloring effect corresponding to the picture can be accurately obtained, so that the image processing algorithm can achieve the purpose of simulating PowerPoint according to the color value and accurately restoring the picture resource, and the problem that the custom re-coloring effect in PowerPoint is difficult to copy by using PS in the prior art is effectively solved.
Further, the step S2 includes:
acquiring all files representing PPT page content under the XML file, traversing picture nodes under the files, judging whether nodes for identifying the custom coloring effect exist under the picture nodes, if so, executing the step S3, and if not, not processing.
According to the description, when the picture passes through the custom coloring effect, the original tone of the picture can be changed, so that the node which represents the color value of the picture to be changed can exist under the picture node as the identifier of the custom coloring effect, whether the identifier node exists under the picture node or not is judged, the picture passing through the custom coloring effect can be rapidly determined, and the efficiency of analyzing the content of the node is improved.
Further, the step S3 includes:
s31, analyzing the node content for identifying the custom coloring effect, acquiring a custom coloring effect color value of the picture and a unique identifier of the picture, and storing the custom coloring effect color value and the unique identifier of the picture in an array in a JSON data format;
s32, traversing all the unique identifiers stored in the array, and respectively executing the following steps for each unique identifier:
s321, matching a relative path of the corresponding picture resource in the page resource associated file according to the unique identifier, acquiring the picture resource by using the relative path, and storing the picture resource in a project directory in a file form;
s322, establishing a corresponding relation between the color value of the customized coloring effect corresponding to the unique identifier of the picture and the picture resource according to the unique identifier of the picture.
According to the description, the customized recoloring function in the PowerPoint can conveniently and quickly change the color of the picture according to the user needs, so that the preset color value of the picture when the customized recoloring is performed is obtained, and the purpose of accurately simulating the customized recoloring effect in the PowerPoint can be achieved according to the color value, the problem that the customized recoloring effect in the PowerPoint is difficult to copy by using a PS (packet switch) in the traditional method is effectively solved, meanwhile, the picture resource is obtained through the unique identifier of the picture, the corresponding relation between the customized recoloring effect color value corresponding to the picture resource and the picture resource is established according to the unique identifier of the picture, the subsequent processing of the corresponding customized recoloring effect on the picture resource can be ensured in a targeted manner, the accuracy of the picture effect reduction process is further ensured, in addition, data are saved through a JSON array, data transmission is facilitated, and redundant characters are reduced.
Further, the step S4 includes:
traversing all the picture resources stored in the project directory, and respectively executing the following steps on each picture resource:
acquiring a JSON array for storing the color value of the custom coloring effect according to the corresponding relation between the picture resource and the color value of the custom coloring effect, reading the corresponding color value of the custom coloring effect by using the JSON array, transmitting the color value of the custom coloring effect to a preset image processing algorithm, and performing custom coloring effect restoration on the picture resource by using the image processing algorithm.
According to the description, the user-defined coloring effect color values stored in the transferred JSON array are directly acquired through the corresponding relation between the picture resources and the user-defined coloring effect color values, the efficiency of the reduction process is improved, the picture resources are processed by using an image processing algorithm with the picture user-defined coloring effect color values, the picture is reduced strictly according to the transferred color value parameters, and the purpose of one-to-one effect copying is achieved.
Further, the step S4 of restoring the custom coloring effect of the picture resource by using the image processing algorithm includes:
traversing all pixels of the picture resource, and respectively executing for each pixel:
and acquiring the color value of the pixel, calculating the color value of the pixel of the picture after the processing of the custom coloring effect according to the transferred custom coloring effect color value, and re-assigning the color value of the pixel according to the calculation result.
As can be seen from the above description, the pixels are basic primitive elements and basic codes of gray levels thereof, and are basic units constituting the picture, so that the color values of each pixel unit in the picture are reassigned according to the transmitted color value parameters of the customized coloring effect by using a preset image processing algorithm, and the overall effect of picture restoration can be effectively guaranteed.
Example one
Referring to fig. 1, a method for restoring a custom coloring effect of a picture in PPT specifically includes the steps of:
s1, reading an XML file under a PPTX compression format file;
specifically, the format suffix of the PPTX file is changed into rar, specified file content in the PPTX compressed format file is read by using a zlib function library, and an XML file under the specified file content is read by using an RAPIDxml parsing library.
S2, traversing the node content under the XML file, and determining the picture with the customized coloring effect;
specifically, the step S2 includes:
acquiring all files representing PPT page content under the XML file, traversing picture nodes under the files, judging whether nodes for identifying the custom coloring effect exist under the picture nodes, if so, executing the step S3, and if not, not processing.
Specifically, all files slide #. Xml representing PPT page content and slide #. Xml.rels in slides directory under PPT directory in PPTX decompression directory are obtained, all picture nodes p: pic under slide #. Xml file are traversed, whether a: duotone nodes exist in a: blip nodes of the p: blipFill nodes under the nodes is judged, if yes, the pictures corresponding to the picture nodes are judged to be processed through the custom coloring effect in PowerPoint, and step S3 is executed.
S3, analyzing the node content corresponding to the picture with the customized coloring effect, and acquiring the color value and the picture resource of the customized coloring effect;
specifically, the step S3 includes:
s31, analyzing the node content for identifying the custom coloring effect, acquiring a custom coloring effect color value of the picture and a unique identifier of the picture, and storing the custom coloring effect color value and the unique identifier of the picture in an array in a JSON data format;
specifically, the content of a node under a duotone node is analyzed, a: prstClr node exists under the duotone node, a value attribute value in the node represents a color value of a primary color selected when the picture is set to be customized and colored, the color value is expressed in English, the color value at the time is assumed to be "black", the color value is converted into a color value #000000 expressed in hexadecimal according to a template dictionary existing on the network and expressed in BaseColor, one of a schemeClr node and a srgbClr node exists under a peer node of the prstClr node, the a: schemeClr node represents that a coloring effect selected by a user is in a color value range defined by a slide master or a slide subject, the a: srgbCll node represents that a coloring effect color value is not in the above definition, the user is provided with a value attribute representing an analyzed color value under the node when the node is a custom, the color value is assumed to be a corresponding to a corresponding file 1, the obtained by using the attribute, the obtained by obtaining the corresponding value of the corresponding Target attribute 1 # when the file exists in the file 1, the Target. The value attribute value of the node is the color value designated by tx1, the color value is obtained, an a: tint node and an a: satMod node exist under the a: schemeClr node, the value attribute value under the node is divided by 100000 to represent the hue value and the saturation value of the custom coloring color value, the color value designated by tx1, the hue value and the saturation value are converted through a conventional HSL space to obtain the adjusted color value, and the adjusted color value is represented by TransColor.
When the node is an a: srgbClr node, the value attribute value under the node is directly the color value represented by hexadecimal, meanwhile, an a: tint node and an a: satMod node also exist under the a: srgbClr node, the value attribute value under the node is divided by 100000 to represent the hue value and the saturation value of the custom coloring color value respectively, and the color value, the hue value and the saturation value are converted through a conventional HSL space to obtain the adjusted color value which is represented by TransColor.
And acquiring an embedded value r in the a: blip node under the p: pic of the picture, wherein the r: embedded value is the unique identifier of the picture, and storing the custom coloring effect, the BaseCoolor, the TransColor and the r: embedded value corresponding to the picture node in an array in a JSON data format.
S32, traversing all the unique identifiers stored in the array, and respectively executing the following steps for each unique identifier:
s321, matching a relative path of the corresponding picture resource in the page resource associated file according to the unique identifier, acquiring the picture resource by using the relative path, and storing the picture resource in a project directory in a file form;
specifically, all r: embed values stored in the JSON array are traversed, target attributes in a Relationship node are matched in slide #. Xml.rels files of corresponding page numbers by the r: embed values, corresponding picture resources are obtained according to relative paths provided by the Target attributes, and the picture resources are stored in a project directory in a file form.
S322, establishing a corresponding relation between the self-defined coloring effect color value corresponding to the unique identifier of the picture and the picture resource.
Specifically, the corresponding relation between the custom coloring effect color value and the picture resource is established according to the corresponding relation between the r: embed value and the custom coloring effect color value and the corresponding relation between the r: embed value and the picture resource.
And S4, carrying out self-defined coloring effect restoration on the picture resource by utilizing a preset image processing algorithm according to the color value of the self-defined coloring effect.
Specifically, the step S4 includes:
traversing all the picture resources stored in the project directory, and respectively executing the following steps on each picture resource:
acquiring a JSON array for storing the color value of the custom coloring effect according to the corresponding relation between the picture resource and the color value of the custom coloring effect, reading the corresponding color value of the custom coloring effect by using the JSON array, transmitting the color value of the custom coloring effect to a preset image processing algorithm, and restoring the custom coloring effect to the picture resource by using the image processing algorithm.
Specifically, traversing all picture resources stored in a project directory, obtaining a JSON array storing a color value of a custom coloring effect according to a corresponding relation between the picture resources and the color value of the custom coloring effect, reading a BaseCoolor and a TransColor corresponding to the picture resources by using the JSON array, transmitting the parameter value to a preset image processing algorithm, and performing custom coloring effect restoration on the picture resources by using the image processing algorithm.
Specifically, the step S4 of restoring the custom coloring effect of the picture resource by using the image processing algorithm includes:
traversing all pixels of the picture resource, and respectively executing for each pixel:
and acquiring the color value of the pixel, calculating the color value of the pixel of the picture after the processing of the custom coloring effect according to the transferred custom coloring effect color value, and re-assigning the color value of the pixel according to the calculation result.
Specifically, all pixels of the picture resource are traversed, and for each pixel, the following is respectively performed:
obtaining the color value of the current pixel, expressing the color value by r, g and b, and calculating the gray value of the current pixel, wherein f expresses that the solved numerical value is a floating point number:
gray=(29f*b+150f*g+76f*r)/255f
r, G and B respectively represent R, G and B values of pixels after being processed by a preset image processing algorithm, and the formula is as follows:
R=(255-gray)*BaseColor.R/255+gray*TransColor.R/255
G=(255-gray)*BaseColor.G/255+gray*TransColor.G/255
B=(255-gray)*BaseColor.B/255+gray*TransColor.B/255
wherein BaseCoolor.R represents a red color value in BaseCoolor, baseCoolor.G represents a green color value in BaseCoolor, baseCoolor.B represents a blue color value in BaseCoolor, transColor.R represents a red color value in TransColor, transColor.G represents a green color value in TransColor, transColor.B represents a blue color value in TransColor, and the calculated R, G, B requirement limit is [0,255].
Example two
Referring to fig. 2, a terminal 1 for restoring a custom coloring effect of a picture in a PPT includes a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3, where the processor 3 implements the steps in the first embodiment when executing the computer program.
In summary, the present invention provides a method and a terminal for restoring a custom coloring effect of a picture in a PPT, wherein an XML file in a PPTX compressed format file includes a tag for describing element information in a PPT page, and therefore, by reading the XML file in the PPTX file through zlib and RAPIDxml, and analyzing node content in the XML file, a picture with a custom coloring effect in the PPTX file can be quickly located, and parameters required in a picture restoring process can be accurately obtained, including a picture custom coloring effect color value and a unique picture identifier, so that an image processing algorithm can calculate according to the custom coloring effect color value, and change a color value of a pixel in a corresponding picture resource, thereby achieving an object of simulating a PowerPoint to accurately restore a picture effect, effectively solving a problem that it is difficult to copy a custom re-coloring effect in a PowerPoint by using a PS conventionally, and simultaneously, obtaining a picture resource through the unique picture identifier, establishing a corresponding relationship between the custom coloring identifier effect and a color value corresponding to the picture resource according to the unique picture identifier of the picture, and ensuring that the picture can be further processed accurately according to different parameters of the transferred picture restoring effect.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to the related technical fields, are included in the scope of the present invention.

Claims (6)

1. A method for restoring a picture custom coloring effect in PPT is characterized by comprising the following steps:
s1, reading an XML file under a PPTX compression format file;
s2, traversing the node content under the XML file, and determining the picture with the customized coloring effect;
s3, analyzing the node content corresponding to the picture with the customized coloring effect, and acquiring the color value and the picture resource of the customized coloring effect;
s4, carrying out custom coloring effect restoration on the picture resource by using a preset image processing algorithm according to the color value of the custom coloring effect;
the step S3 includes:
s31, analyzing the node content for identifying the custom coloring effect, acquiring a custom coloring effect color value of the picture and a unique identifier of the picture, and storing the custom coloring effect color value and the unique identifier of the picture in an array in a JSON data format;
s32, traversing all the unique identifiers stored in the array, and respectively executing the following steps for each unique identifier:
s321, matching a relative path of the corresponding picture resource in the page resource associated file according to the unique identifier, acquiring the picture resource by using the relative path, and storing the picture resource in a project directory in a file form;
s322, establishing a corresponding relation between the color value of the customized coloring effect corresponding to the unique identifier of the picture and the picture resource according to the unique identifier of the picture;
the step S4 includes:
traversing all the picture resources stored in the project directory, and respectively executing the following steps on each picture resource:
acquiring a JSON array for storing the color value of the custom coloring effect according to the corresponding relation between the picture resource and the color value of the custom coloring effect, reading the corresponding color value of the custom coloring effect by using the JSON array, transmitting the color value of the custom coloring effect to a preset image processing algorithm, and restoring the custom coloring effect to the picture resource by using the image processing algorithm.
2. The method for restoring the customized coloring effect of the picture in the PPT according to claim 1, wherein the step S2 comprises:
acquiring all files representing PPT page content under the XML file, traversing picture nodes under the files, judging whether nodes for identifying the custom coloring effect exist under the picture nodes, if so, executing the step S3, and if not, not processing.
3. The method for restoring the custom coloring effect of the picture in the PPT according to claim 1, wherein the step S4 of restoring the custom coloring effect of the picture resource by using the image processing algorithm comprises:
traversing all pixels of the picture resource, and respectively executing for each pixel:
and acquiring the color value of the pixel, calculating the color value of the pixel of the picture after the processing of the custom coloring effect according to the transferred custom coloring effect color value, and re-assigning the color value of the pixel according to the calculation result.
4. A terminal for restoring a custom coloring effect of a picture in PPT (Power Point), comprising a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to realize the following steps:
s1, reading an XML file under a PPTX compression format file;
s2, traversing the node content under the XML file, and determining the picture with the customized coloring effect;
s3, analyzing the node content corresponding to the picture with the customized coloring effect, and acquiring the color value and the picture resource of the customized coloring effect;
s4, performing customized coloring effect restoration on the picture resource by using a preset image processing algorithm according to the color value of the customized coloring effect;
the step S3 includes:
s31, analyzing the node content for identifying the custom coloring effect, acquiring a custom coloring effect color value of the picture and a unique identifier of the picture, and storing the custom coloring effect color value and the unique identifier of the picture in an array in a JSON data format;
s32, traversing all the unique identifiers stored in the array, and respectively executing the following steps to each unique identifier:
s321, matching a relative path of the corresponding picture resource in the page resource associated file according to the unique identifier, acquiring the picture resource by using the relative path, and storing the picture resource in a project directory in a file form;
s322, establishing a corresponding relation between the self-defined coloring effect color value corresponding to the unique identifier of the picture and the picture resource according to the unique identifier of the picture;
the step S4 includes:
traversing all the picture resources stored in the project directory, and respectively executing the following steps on each picture resource:
acquiring a JSON array for storing the color value of the custom coloring effect according to the corresponding relation between the picture resource and the color value of the custom coloring effect, reading the corresponding color value of the custom coloring effect by using the JSON array, transmitting the color value of the custom coloring effect to a preset image processing algorithm, and restoring the custom coloring effect to the picture resource by using the image processing algorithm.
5. The terminal for restoring customized coloring effect of picture in PPT according to claim 4, wherein said step S2 comprises:
acquiring all files representing PPT page content under the XML file, traversing picture nodes under the files, judging whether nodes for identifying the custom coloring effect exist under the picture nodes, if so, executing the step S3, and if not, not processing.
6. The terminal for restoring customized rendering effect of picture in PPT according to claim 4, wherein said restoring customized rendering effect of the picture resource by using the image processing algorithm in step S4 comprises:
traversing all pixels of the picture resource, and respectively executing for each pixel:
and acquiring the color value of the pixel, calculating the color value of the pixel of the picture after the processing of the custom coloring effect according to the transferred custom coloring effect color value, and re-assigning the color value of the pixel according to the calculation result.
CN201911413319.6A 2019-12-31 2019-12-31 Method and terminal for restoring custom coloring effect of picture in PPT Active CN111178013B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911413319.6A CN111178013B (en) 2019-12-31 2019-12-31 Method and terminal for restoring custom coloring effect of picture in PPT

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911413319.6A CN111178013B (en) 2019-12-31 2019-12-31 Method and terminal for restoring custom coloring effect of picture in PPT

Publications (2)

Publication Number Publication Date
CN111178013A CN111178013A (en) 2020-05-19
CN111178013B true CN111178013B (en) 2022-10-18

Family

ID=70655950

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911413319.6A Active CN111178013B (en) 2019-12-31 2019-12-31 Method and terminal for restoring custom coloring effect of picture in PPT

Country Status (1)

Country Link
CN (1) CN111178013B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103108147A (en) * 2013-02-05 2013-05-15 深圳市中科睿成智能科技有限公司 System and method used for character and image projected display
CN107066430A (en) * 2017-04-21 2017-08-18 广州爱九游信息技术有限公司 Image processing method, device, service end and client
CN108320312A (en) * 2017-01-18 2018-07-24 阿里巴巴集团控股有限公司 Color matching method and device, the terminal of picture

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020165881A1 (en) * 2001-03-15 2002-11-07 Imation Corp. Web page color accuracy using color-customized style sheets

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103108147A (en) * 2013-02-05 2013-05-15 深圳市中科睿成智能科技有限公司 System and method used for character and image projected display
CN108320312A (en) * 2017-01-18 2018-07-24 阿里巴巴集团控股有限公司 Color matching method and device, the terminal of picture
CN107066430A (en) * 2017-04-21 2017-08-18 广州爱九游信息技术有限公司 Image processing method, device, service end and client

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
图像合成的艺术;RD;《影像视觉》;20110505(第05期);全文 *

Also Published As

Publication number Publication date
CN111178013A (en) 2020-05-19

Similar Documents

Publication Publication Date Title
TWI407771B (en) Method and apparatus for efficient processing of color conversion
CN101529495B (en) Image mask generation
JPH06233127A (en) Color coincidence processing method and color coincidence processor for executing the same
CN101184149B (en) Color processing apparatus and method
US20080123948A1 (en) Profile creation configuration file
US20180034998A1 (en) Systems and Methods for Separating a Digital Image Using a Specified Colour Palette into a Sequence of Separation Plates Used in a Multi-Stage Printing Process to Produce an Acceptable Facsimile of the Digital Image
JP2008141237A (en) Color processing apparatus and its method
Al-saleem et al. Mathematical representation of color spaces and its role in communication systems
CN111178013B (en) Method and terminal for restoring custom coloring effect of picture in PPT
CN111013131A (en) Delayed data acquisition method, electronic device, and storage medium
US7656414B2 (en) System and method for determination of gray for CIE color conversion using chromaticity
EP1427185A2 (en) Incremental color transform creation
CN107872441B (en) Method and device for generating equipment attribute configuration file
CN110400355B (en) Method and device for determining monochrome video, electronic equipment and storage medium
CN111507895A (en) Image processing method and device, computer storage medium and electronic equipment
JP2018082312A (en) Image control device, patch chart, image forming method, and program
US20190098178A1 (en) Reproduction color profile correction device, reproduction color profile correction method, reproduction color profile correction program, and computer-readable medium including reproduction color profile correction program
Bauer et al. Automated preservation: the case of digital raw photographs
CN111080745B (en) Method and terminal for re-coloring pictures in PowerPoint
CN111340818B (en) Hair dyeing effect graph generation method, device and computer readable storage medium
CN104580817A (en) An image processing apparatus, an image forming apparatus, an image processing system and a method
CN113505844A (en) Label generation method, device, equipment, storage medium and program product
WO2019114133A1 (en) Method and apparatus for altering color of editing page content, terminal, and storage medium
CN111127306B (en) Method and terminal for restoring transparency of picture in PPTX file
CN112053277B (en) Method, device, equipment and storage medium for changing image skin

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant