CN115272095A - Layer processing method and device and electronic equipment - Google Patents

Layer processing method and device and electronic equipment Download PDF

Info

Publication number
CN115272095A
CN115272095A CN202210551318.3A CN202210551318A CN115272095A CN 115272095 A CN115272095 A CN 115272095A CN 202210551318 A CN202210551318 A CN 202210551318A CN 115272095 A CN115272095 A CN 115272095A
Authority
CN
China
Prior art keywords
layer
layers
effect adjustment
effect
mask
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.)
Pending
Application number
CN202210551318.3A
Other languages
Chinese (zh)
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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202210551318.3A priority Critical patent/CN115272095A/en
Publication of CN115272095A publication Critical patent/CN115272095A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention provides a layer processing method, a layer processing device and electronic equipment, which are used for acquiring a plurality of layers to be processed in a target file; determining an effect adjustment layer and a basic display layer corresponding to the effect adjustment layer from a plurality of layers to be processed; the effect adjusting layer is used for adjusting the display effect of the basic display layer; and combining the effect adjustment layer and the basic display layer corresponding to the effect adjustment layer to obtain a target file after the layers are combined. By the mode, the efficiency of layer combination is improved, and the labor cost is reduced.

Description

Layer processing method and device and electronic equipment
Technical Field
The invention relates to the technical field of layer operation, in particular to a layer processing method and device and electronic equipment.
Background
In the related art, after a user generates a basic picture by using a common layer in drawing software, the user also adjusts the effect of the basic picture by using effect adjustment layers such as a mask layer and an adjustment layer to generate a final picture effect. In order to obtain a better picture effect, a user generally needs to set a corresponding adjustment layer and a corresponding mask layer for a part of the common layers. And when the layer of the generated picture is output, combining the basic display layer with the related effect adjusting layer, and only outputting the basic display layer with the picture effect. In the above manner, the operation of merging layers is usually implemented by manual operation, which is high in labor cost and low in efficiency.
Disclosure of Invention
In view of this, the present invention provides a layer processing method, an apparatus and an electronic device, so as to improve the efficiency of layer merging and reduce the labor cost.
In a first aspect, an embodiment of the present invention provides a layer processing method, where the method includes: acquiring a plurality of layers to be processed in a target file; determining an effect adjustment layer and a basic display layer corresponding to the effect adjustment layer from a plurality of layers to be processed; the effect adjusting layer is used for adjusting the display effect of the basic display layer; and combining the effect adjustment layer and the basic display layer corresponding to the effect adjustment layer to obtain a target file after the layers are combined.
The step of obtaining the plurality of layers to be processed in the target file includes: acquiring a target file; the target file comprises a plurality of initial image layers and/or initial image layer groups; preprocessing a target file; the pretreatment comprises at least one of the following modes: unlocking the initial layer; deleting the initial graph layer group with empty content; and determining the initial layer and/or the initial layer group in the preprocessed target file as the layer to be processed.
The effect adjusting layer comprises a first effect adjusting layer and/or a second effect adjusting layer; the step of determining the effect adjustment layer and the basic display layer from the layer to be processed comprises the following steps: searching a mask layer from the layer to be processed; if the map layer is found, determining whether the mask map layer in the map layer to be processed is visible or not based on the attribute information of the mask map layer; if so, determining the mask layer as a first effect adjustment layer; determining a common layer bound by the mask layer as a basic display layer corresponding to the first effect adjustment layer; searching a layer provided with a preset identifier from the layer to be processed; the layer provided with the preset identifier comprises a common layer and/or an adjustment layer; if so, determining whether the found layer is visible or not based on the attribute information of the found layer; if the image layers are visible, determining the image layers with the preset marks as second effect adjustment image layers; and determining the common layer with the hierarchy lower than the second effect adjustment layer as a basic display layer corresponding to the second effect adjustment layer.
The effect adjusting layer comprises a first effect adjusting layer and/or a second effect adjusting layer; the first effect adjustment layer comprises a mask layer; the second effect adjustment layer comprises a layer provided with a preset identifier; the method comprises the steps of combining an effect adjustment layer and a basic display layer corresponding to the effect adjustment layer, wherein the steps comprise; merging the mask layer and the basic display layer corresponding to the mask layer; and/or combining the layer provided with the preset identification with the basic display layer corresponding to the layer provided with the preset identification.
The basic display layer corresponding to the mask layer is a graph layer group; the layer group comprises a plurality of common layers; the method comprises the following steps of combining the mask layer and the basic display layer corresponding to the mask layer, wherein the steps comprise: generating a copy layer of the mask layer aiming at each common layer in the graph layer group corresponding to the mask layer; setting a copy layer of the mask layer as a layer of a previous layer of the common layer; and combining the layer of the previous layer of the common layer with the common layer to obtain a combined layer.
The basic display layer corresponding to the second effect adjustment layer comprises a plurality of common layers; the step of combining the layer provided with the preset identifier and the basic display layer corresponding to the layer provided with the preset identifier comprises the following steps: generating a copy layer of the layer with the preset identifier aiming at each common layer corresponding to the layer with the preset identifier; setting a copy layer of the layer provided with the preset identifier as a layer of the previous layer of the common layer; and combining the layer of the previous layer of the common layer with the common layer to obtain a combined layer.
Before the step of merging the layer provided with the preset identifier and the basic display layer corresponding to the layer provided with the preset identifier, the method further includes: and determining the combined layer as a layer to be processed corresponding to a basic display layer corresponding to the mask layer.
In a second aspect, an embodiment of the present invention provides an apparatus for layer processing, where the apparatus includes: the layer acquiring module is used for acquiring a plurality of layers to be processed in the target file; the layer determining module is used for determining an effect adjusting layer and a basic display layer corresponding to the effect adjusting layer from a plurality of layers to be processed; the effect adjusting layer is used for adjusting the display effect of the basic display layer; and the layer merging module is used for merging the effect adjustment layer and the basic display layer corresponding to the effect adjustment layer to obtain a target file after the layers are merged.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor and a memory, where the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the layer processing method described above.
In a fourth aspect, embodiments of the present invention provide a machine-readable storage medium storing machine-executable instructions, which when invoked and executed by a processor, cause the processor to implement the layer processing method described above.
The embodiment of the invention brings the following beneficial effects:
the layer processing method, the layer processing device and the electronic equipment are used for acquiring a plurality of layers to be processed in a target file; determining an effect adjustment layer and a basic display layer corresponding to the effect adjustment layer from a plurality of layers to be processed; the effect adjusting layer is used for adjusting the display effect of the basic display layer; and combining the effect adjustment layer and the basic display layer corresponding to the effect adjustment layer to obtain a target file after the layers are combined. By the method, the layer merging efficiency is improved, and the labor cost is reduced.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a layer processing method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a background access page displayed to a guest role according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a background access page displayed to a developer role according to an embodiment of the present invention;
fig. 4 is a schematic diagram of an access page of an AMAN management background according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a layer processing apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
With the development of drawing software such as Photoshop (PS), great convenience is provided for drawing work of related workers. Related workers can generate a basic picture by adopting a common layer in drawing software, and establish effect adjusting layers such as a mask layer and an adjusting layer to adjust the effect of the basic picture.
When the display effect of a plurality of common layers needs to be adjusted by using a certain adjustment layer or a common layer, the adjustment layer or the common layer needs to be copied to the previous level of each common layer, and when each common layer with the adjustment effect needs to be output, each common layer needs to be merged with the copied adjustment layer or common layer one by one through manual operation. When the number of the layers is small and the files are not complex, manual operation can be performed on the layers one by one. However, in the case of a complex screen effect and a plurality of layers and layer groups, manual operation not only requires a lot of effort, but also is prone to errors. The mode for processing the image layer has low efficiency and high labor cost.
Based on this, the layer processing method, the layer processing device and the electronic device provided by the embodiment of the invention can be applied to various layer processing scenes.
To facilitate understanding of the embodiment, first, a layer processing method disclosed in the embodiment of the present invention is disclosed, and as shown in fig. 1, the method includes the following steps:
step 102, acquiring a plurality of layers to be processed in a target file.
The target file may be a file created by drawing software. The object file usually includes multiple layers, such as a normal layer, a mask layer, a trim layer, and the like. The mask layer and the adjustment layer are usually bound to a corresponding common layer or a corresponding graph layer group, and are located at a previous level of the common layer or the graph layer group to adjust the display effect of the picture. In some drawing software, the hierarchical relationship between layers may be represented by the relative positions of the layers displayed on the layer interface, and the layer adjacent to a certain layer above the certain layer is located at a previous level of the layer. As shown in fig. 2, layer 1 is located at a level above layer 2, and layer 2 is located at a level above layer 3. When the final effect picture is generated, a picture in a layer of an upper level is displayed on a picture in a layer of a lower level.
After a user establishes layers in a target file, some layers may be locked, for example, background layers in a PS file are locked during establishment. When the layer is locked, it cannot be altered. Therefore, if the display effect of the layer needs to be adjusted, the layer needs to be unlocked. When a user forms a certain part in a picture through some layers, for example, five sense organs of a character are generated in different layers, a layer group can be established to store the layers to indicate that the layers belong to the same part. The layer group in the target file may not include a layer, and the content of the layer group is empty at this time, and since the empty layer group has no effect, the layer group whose content is empty may be deleted before the layer in the target file is processed.
The layers to be processed may be all layers in the target file, or may be part of layers in the target file. The user can set an identifier for the layer to be processed in the target file according to the requirement, for example, a set character is added to the name of the layer to be processed, so as to distinguish the layer from other layers which do not need to be processed. In specific implementation, the layer with the identifier in the target file may be selected as the layer to be processed.
104, determining an effect adjustment layer and a basic display layer corresponding to the effect adjustment layer from a plurality of layers to be processed; the effect adjusting layer is used for adjusting the display effect of the basic display layer.
The effect adjustment layer is generally an adjustment layer bound to a single common layer or a layer group. The adjustment layer can perform operations such as color gradation, hue curve and the like on the image under the condition of not encircling the original image (namely the bound common layer), and the image can be beautified by adjusting different settings of the layer. When a partial picture of each common layer in a single common layer or layer group needs to be adjusted, a mask layer (also referred to as a "cut mask") needs to be further arranged on the single common layer or layer group. The mask layer can cover the objects of other drawings by the shape, and effectively cuts the drawings into the shape of the mask. The mask layer has a transparent part and a non-transparent part, and after the adjustment layer, the mask layer and the bound common layer are combined, the picture effect generated by the adjustment layer can be displayed at the picture position corresponding to the transparent part of the mask layer in the combined layer.
During specific implementation, data in the target file can be analyzed, and a mask layer in the target file and a common layer bound with the mask layer are identified; and further determining the common layer as a basic display layer corresponding to the mask layer.
The effect adjustment layer may also be a normal layer. The common layer can be edited arbitrarily, and comprises a series of operations of transparency, size modification, deletion, order adjustment and the like. When the common layer is used as the effect adjustment layer, the effect adjustment function is usually performed on other common layers. In some documents, multiple common layers may be used to display different parts of a picture. When layer merging is performed, the layers need to be merged together. The common layer with the lowest hierarchy may be regarded as a basic display layer, and the other common layers may be regarded as effect adjustment layers. For example, in an object file for generating a face image, in order to modify five sense organs, the eye, nose, mouth and face contours may be generated by using a common layer, wherein the face contour is located at the lowest level; when the layers are combined, the layer at the lowest level where the face contour is generated is required to be used as a basic display layer, and the layer where the eyes, the nose and the mouth are located is required to be used as an effect adjustment layer.
In the above case, in order to distinguish the ordinary layers as the effect adjustment layers from other layers, it is necessary to set specific identifiers for the ordinary layers, such as adding specific symbols to the names of the ordinary layers. When the adjustment layer is displayed on the final picture corresponding to the file, the effect of the adjustment layer can adjust all layers below the level of the adjustment layer, and the adjustment effect is consistent with that of the common layer, so that when the effect adjustment layer is determined, the adjustment layer and the common layer are not distinguished, and a feature identifier is usually also set in the adjustment layer. If the layer to be processed with the specific identifier is identified after the data of the target file is analyzed, the layer to be processed may be determined as an effect adjustment layer. Because a layer picture of a certain level can cover a layer picture of a level below the level, a layer to be processed of the level below the level of the effect adjustment layer is set as a basic display layer.
Compared with the effect adjustment layer which can be an adjustment layer, a mask layer or a common layer, the basic display layer is usually a common layer, and specifically can be a common layer on which a relatively important basic picture is displayed in the target file. For example, the base picture in the target file shows a sailboat in the sea; the sea may be represented by a layer filled with blue (hereinafter, referred to as "sea layer"), and the sailboat may be represented by a layer on which a sailboat line is displayed (hereinafter, referred to as "sailboat layer"), and these two layers may generally be used as base display layers.
In order to enrich the color of the sea, an adjustment layer can be established on the blue layer, and the parameters of the adjustment layer are changed, so that the displayed color level after the adjustment layer and the sea layer are superposed is richer. In order to enable the color of the sailing boat to be different from that of the sea, a mask layer can be built on the sailing boat layer, the transparent part of the mask layer is overlapped with the sailing boat part, then a common layer is built on the mask layer, the common layer can be filled with the color of the sailing boat, and at the moment, after the common layer, the mask layer and the sailing boat layer are overlapped, the sailing boat displays the color filled in the common layer. The common layer and the mask layer are effect adjustment layers of a sailboat layer, and the sailboat layer is a basic display layer of the common layer and the mask layer.
In the above target file, if only one map layer needs to be displayed at last, the sailboat map layer may also be regarded as the effect adjustment map layer of the marine map layer. Therefore, the basic display layer needs to be determined according to the functional requirement of the layer by the user, and it cannot be determined whether the layer is the basic display layer only through the basic attribute of the layer. The user can set different identifiers for the effect adjustment layer and the basic display layer according to the functional requirements on different layers, and different prefixes are adopted in naming, so that the effect adjustment layer and the basic display layer are quickly determined when the method is adopted for layer processing.
And 106, combining the effect adjustment layer and the basic display layer corresponding to the effect adjustment layer to obtain a target file after the layers are combined.
In the actual processing, it may be that one effect adjustment layer corresponds to one base display layer; if possible, the plurality of effect adjustment layers correspond to a base display layer; the base display layer may refer to a common layer or a group of layers including a plurality of common layers.
When one effect adjustment layer corresponds to one common layer, the effect adjustment layer and the common layer may be directly merged to obtain a merged layer.
When a plurality of effect adjustment layers correspond to one common layer, the effect adjustment layers and the common layer may be sequentially merged based on a hierarchical relationship between the effect adjustment layers and the common layer; generally, the effect adjustment layer located at a previous level of the normal layer is merged with the normal layer, and then the effect adjustment layer located at a previous level of the merged layer is merged with the normal layer in sequence.
When one effect adjustment layer corresponds to a plurality of ordinary layers, the effect adjustment layer may be copied, the plurality of layers obtained by copying are respectively disposed on a level above each ordinary layer, each ordinary layer is respectively merged with the layer on the level above the ordinary layer, and after merging, the original effect adjustment layer may be deleted.
When the plurality of effect adjustment layers correspond to a layer group including a plurality of common layers, the plurality of effect adjustment layers can be regarded as a whole, the plurality of effect adjustment layers are copied, the plurality of copied effect adjustment layers are respectively arranged on the previous layer level of each common layer, then each common layer and the plurality of effect adjustment layers on the previous layer level are combined one by one, and finally, a target file after layer combination is obtained.
The layer processing method obtains a plurality of layers to be processed in a target file; determining an effect adjustment layer and a basic display layer corresponding to the effect adjustment layer from a plurality of layers to be processed; the effect adjusting layer is used for adjusting the display effect of the basic display layer; and combining the effect adjustment layer and the basic display layer corresponding to the effect adjustment layer to obtain a target file after the layers are combined. By the mode, the efficiency of layer combination is improved, and the labor cost is reduced.
The following embodiments provide specific implementation manners for obtaining multiple layers to be processed in a target file
Firstly, acquiring a target file; specifically, when the user has finished editing the drawing file, needs to output the picture content formed by the drawing file, and does not need to save the original drawing file, the drawing file may be used as the target file; when the screen content formed by the drawing file needs to be output, but the original drawing file needs to be saved, a copy of the drawing file needs to be generated, and the generated copy file is used as a target file.
The retrieved object file generally includes a plurality of initial layers, which may also be displayed in a layer group, which may be referred to as an initial layer group. After the target file is obtained, preprocessing the target file; the preprocessing may be to unlock the initial layer. In some drawing software, a locking mark is usually displayed at a set position of an icon of a layer, and if the locking mark is selected, some parameters of the layer are changed, so that the layer cannot be edited, that is, the layer is locked. The unlocking process is usually to cancel the selected operation on the locking identifier, and may also directly modify the parameters of the layer related to the locking, so that the layer is in a state that can be edited. When the target file comprises an initial graph layer group, the initial graph layer group with empty content is also required to be deleted; and determining the initial image layers in the preprocessed target file as the image layers to be processed, wherein if the preprocessed target file further comprises the initial image layer groups, the initial image layer groups can also be determined as the image layers to be processed.
The following embodiments provide specific implementations for determining an effect adjustment layer and a base display layer corresponding to the effect adjustment layer.
In general, the layer to be processed includes an adjustment layer and a normal layer; in some cases the layer to be processed further comprises a mask layer; the common layer can exist in a pattern layer group form; the layer group comprises a plurality of common layers.
Because the mask layer is bound on the common layer, the mask layer is used for adjusting the display area of the display effect of the common layer, and only the bound common layer has the adjustment effect, the mask layer needs to be searched from a plurality of layers to be processed, and if the mask layer is searched, whether the mask layer in the layers to be processed is visible is determined based on the attribute information of the mask layer; if so, determining the mask layer as a first effect adjustment layer; and determining the layer to be processed bound by the mask layer as a basic display layer corresponding to the first effect adjustment layer. The attribute information of the mask layer can be obtained by analyzing the data of the target file. When mask layers are not visible, these layers may be deleted.
When displaying, no matter whether the layer is a normal layer or an adjustment layer, the layer with the higher hierarchy than other layers can cover the pictures of other layers, which can also be called as having an adjustment effect. The user can set a preset identifier for the layer used for adjusting other layers so as to distinguish the basic display layer and the effect adjustment layer. The layer with the preset identifier may be regarded as an effect adjustment layer, for example, the name of the layer is set to "a certain". Specifically, a layer provided with a preset identifier may be searched from a layer to be processed, and if the layer is found, whether the found layer is visible or not is determined based on the attribute information of the found layer; if the image layers are visible, determining the image layers with the preset marks as second effect adjustment image layers; and determining the common layer with the hierarchy lower than the second effect adjustment layer as a basic display layer corresponding to the second effect adjustment layer. The layer attribute information with the preset identifier can be obtained by analyzing data of the target file. When the layer with the preset identifier in the layer to be processed is invisible, the layers can be deleted.
The following embodiments provide specific implementation manners for merging the effect adjustment layer and the basic display layer corresponding to the effect adjustment layer.
Because the effect adjustment modes of the mask layer, the adjustment layer and the common layer are different, the mask layer can be regarded as a first effect adjustment layer; and regarding the layer provided with the preset identification as a second effect adjustment layer. In specific implementation, if the layer to be processed only includes a mask layer or a layer provided with a preset identifier, the mask layer or the layer provided with the preset identifier is directly merged with the corresponding basic display layer. If the to-be-processed layer comprises a mask layer and a layer provided with a preset identifier, the mask layer and a basic display layer corresponding to the mask layer can be firstly combined; and then merging the layer provided with the preset identifier and the corresponding basic display layer. In the above process, since the mask layer and the basic display layer corresponding to the layer provided with the preset identifier may be repeated, if the effect adjustment layer includes the first effect adjustment layer and the second effect adjustment layer, after the mask layer (i.e., the first effect adjustment layer) and the corresponding basic display layer are merged, the merged layer needs to be determined as the layer to be processed corresponding to the basic display layer corresponding to the mask layer, so as not to affect the merging process of the second effect adjustment layer and the corresponding basic display layer.
When the base display layer corresponding to the mask layer is a layer group and the layer group includes a plurality of common layers, a copy layer of the mask layer may be generated for each common layer in the layer group corresponding to the mask layer; setting a copy layer of the mask layer as a layer of the upper layer of the common layer; and combining the layer of the previous layer of the common layer with the common layer to obtain a combined layer. As shown in fig. 3, the mask layer a1 may be copied onto the layers B1, B2 of the layer group, respectively, and then the copied layers B1, c1 may be merged with B1, B2, respectively.
When the base display layer corresponding to the second effect adjustment layer includes a plurality of common layers, a duplicate layer of the layer provided with the preset identifier may be generated for each common layer corresponding to the layer provided with the preset identifier; setting a copy layer of the layer provided with the preset identifier as a layer of the previous layer of the common layer; and combining the layer of the previous layer of the common layer with the common layer to obtain a combined layer. As shown in fig. 4, the adjustment layer a2 may be copied to layers B1 and B2 of the layer group, and then the copied layers B2 and c2 may be merged with layers B1 and B2.
The embodiment of the invention also provides another layer processing method, which is realized on the basis of the method shown in the figure 1. The method can be realized by a plug-in tool (also called a 'PS script tool') embedded with PS software. The tool functions as a batch merging and adjusting layer.
In the related art, manual merging of ps adjustment layers requires manual judgment of nesting logics of the image layer groups, and a large amount of manpower is consumed and errors are prone to occur under the condition that files are complex. The method can reduce the working time and reduce the errors which can occur during manual combination. For the files of PS CS6 and above versions, when the script tool is used, the original file can be reserved, and simultaneously, a new file after layer combination can be generated by one key. The method is suitable for outputting the images of the scene original pictures to the scene editing classmates in batches; and processing image files in batches by original painting classmates.
The layer merging process realized by the method comprises the following steps: the layer named as 'a certain' can be automatically copied and merged with the layer below (both the ordinary layer and the adjusting layer); the mask layer is automatically merged with the corresponding layer.
For example, the function of adjusting layer a is a gradient map, there are 100 layers below, and a gradient map can be automatically copied 100 times to be respectively combined with 100 layers.
The method can be realized by a PS script tool based on JavaScript, and the processing of one PS file by the method comprises the following steps:
1. and opening the file and executing the script.
2. The naming is confirmed by prompt box 1. After the script is executed, a prompt box 1 is popped up on the user interface: please confirm that the layers needing to be operated are named as 'a certain place', and continue to run the script according to 'yes'.
3. The file renaming and file saving are as follows: after the script continues to run, the current file path and the file name are obtained, the current file path and the file name are converted into character strings, the current file is copied, and the current file is saved as' file path + file name + _ adjust.
4. And opening the saved new file.
5. Unlocking all layers: judging whether a layer named as background exists in the file or not, if yes, unlocking the layer, and naming the layer as layer 0 by ps, and renaming the layer as background. And selecting all layers, locking the layers, unlocking the layers and canceling the selection. And realizing the state that all layers are unlocked.
6. And judging whether the file contains an empty group (namely an empty folder) or not, and if so, reminding a user to delete the empty group (returning to a source file clearing empty group can be performed). Specifically, an empty array 1 may be defined, and a file may be searched to determine whether an empty layer group exists, and if so, the name of the empty layer group is stored in the array. If the array 1 is not empty, a prompt box 2 pops up to remind the user to delete the empty array, the original file is returned according to 'yes', and the file exits according to 'no'. If the array is empty, the operation is continued.
7. The layers that are not visible, beginning with "a", and the mask layers that are not visible are deleted. Specifically, it may be determined whether an invisible layer beginning with "a" exists in the file, and if so, the layer may be deleted. And judging whether an invisible shearing mask layer exists in the file or not, and if so, deleting the layer. They do not participate in the following operations, and all layers that need to be copied in the file are visible and not in a locked state.
8. And merging the common layer and the corresponding mask layer. Specifically, it may be determined whether there is a cut mask layer (i.e., the "mask layer" described above) on the normal layer, and if there is a cut mask layer, the name and the visible state of the normal layer are recorded, the mask layer and the normal layer are merged, and the name and the visible state of the normal layer are assigned to the layer.
9. And respectively copying and combining the image layers in the image layer group and the corresponding masks. Specifically, whether a cut mask layer exists on a graph layer group is judged, if yes, then for each layer in the graph layer group, the mask above the graph layer group is copied to the top of the layer from bottom to top (multiple layers may exist), a cut mask is created and merged with the ordinary layer, and the layer is named as the name of the original ordinary layer.
10. And deleting all mask layers in the file.
11. The layers starting with "a" and the layers below are copied and merged respectively.
Specifically, whether the layer beginning with the 'a' exists in the file or not is judged, if yes, the layers are respectively copied, the layers are moved to the upper portion of each ordinary layer, a cutting mask is created and combined with the ordinary layers, and the layers are named as the names of the original ordinary layers.
12. And deleting all layers beginning with the 'a' in the file.
13. And saving the processed file. At this time, a prompt box 3 is popped up on the user interface to prompt that the running is finished.
The method changes the traditional layer processing mode that the work of combining layers can only be finished manually, a large amount of manpower is consumed, and mistakes are easy to make, when the script plug-in is used, the mode can automatically judge files according to code logic, automatically copy and combine the layers needing to be adjusted, realize a layer processing process of bonding and exporting, improve the working efficiency, and can finish a large amount of layer processing work quickly.
In the specific implementation process, the target file is processed by adopting the method, so that the following effects can be realized: the target file before processing has 118 layers, 23 groups, nesting relation exists among the groups, and the layers are adjusted to point to a single layer or a graph layer group. Pointing to a single layer, and combining the adjustment layer and the single layer; directing to the graph layer group, the adjustment layer needs to be copied for multiple times and merged with each layer in the group. The processed file has 106 layers, 23 groups, and the structures of the layers and the groups are unchanged. The adjustment layer is combined with the corresponding layer, and only a common layer exists in the existing file, so that the operation after the original picture classmates is convenient.
For the above method embodiment, refer to a layer processing apparatus shown in fig. 5, where the apparatus includes:
the layer acquiring module 502 is configured to acquire a plurality of layers to be processed in a target file;
the layer determining module 504 is configured to determine an effect adjustment layer and a base display layer corresponding to the effect adjustment layer from the multiple layers to be processed; the effect adjusting layer is used for adjusting the display effect of the basic display layer;
a layer merging module 506, configured to merge the effect adjustment layer and the basic display layer corresponding to the effect adjustment layer to obtain a target file after layer merging
The layer processing device acquires a plurality of layers to be processed in a target file; determining an effect adjustment layer and a basic display layer corresponding to the effect adjustment layer from a plurality of layers to be processed; the effect adjusting layer is used for adjusting the display effect of the basic display layer; and combining the effect adjustment layer and the basic display layer corresponding to the effect adjustment layer to obtain a target file after the layers are combined. By the mode, the efficiency of layer combination is improved, and the labor cost is reduced.
The layer acquiring module is further configured to: acquiring a target file; the target file comprises a plurality of initial image layers and/or initial image layer groups; preprocessing a target file; the pretreatment comprises at least one of the following modes: unlocking the initial layer; deleting the initial graph layer group with empty content; and determining the initial layer and/or the initial layer group in the preprocessed target file as the layer to be processed.
The effect adjusting layer comprises a first effect adjusting layer and/or a second effect adjusting layer; the layer determining module is further configured to: searching a mask layer from the layer to be processed; if the mask layer is found, determining whether the mask layer in the layer to be processed is visible or not based on the attribute information of the mask layer; if so, determining the mask layer as a first effect adjustment layer; determining a common layer bound by the mask layer as a basic display layer corresponding to the first effect adjustment layer; searching a layer provided with a preset identifier from the layer to be processed; the layer provided with the preset identifier comprises a common layer and/or an adjustment layer; if so, determining whether the found layer is visible or not based on the attribute information of the found layer; if the image layers are visible, determining the image layers with the preset marks as second effect adjustment image layers; and determining the common layer with the hierarchy lower than the second effect adjustment layer as a basic display layer corresponding to the second effect adjustment layer.
The effect adjusting layer comprises a first effect adjusting layer and/or a second effect adjusting layer; the first effect adjustment layer comprises a mask layer; the second effect adjustment layer comprises a layer provided with a preset identifier; the layer merging module comprises; the first merging unit is used for merging the mask layer and the basic display layer corresponding to the mask layer; and the second merging unit is used for merging the layer provided with the preset identifier and the basic display layer corresponding to the layer provided with the preset identifier.
The basic display layer corresponding to the mask layer is a picture layer group; the layer group comprises a plurality of common layers; the first merging unit is further configured to: generating a copy layer of the mask layer aiming at each common layer in the graph layer group corresponding to the mask layer; setting a copy layer of the mask layer as a layer of a previous layer of the common layer; and combining the layer of the previous layer of the common layer with the common layer to obtain a combined layer.
The basic display layer corresponding to the second effect adjustment layer comprises a plurality of common layers; the second merging unit is further configured to: generating a copy layer of the layer provided with the preset identifier for each common layer corresponding to the layer provided with the preset identifier; setting a copy layer of the layer provided with the preset identifier as a layer of the previous layer of the common layer; and combining the layer of the previous layer of the common layer with the common layer to obtain a combined layer.
The effect adjusting layer comprises a first effect adjusting layer and a second effect adjusting layer; the above-mentioned device still includes: and the layer to be processed determining module is used for determining the combined layer as the layer to be processed corresponding to the basic display layer corresponding to the mask layer.
The embodiment also provides an electronic device, which comprises a processor and a memory, wherein the memory stores machine executable instructions capable of being executed by the processor, and the processor executes the machine executable instructions to implement the layer processing method.
Referring to fig. 6, the electronic device includes a processor 100 and a memory 101, where the memory 101 stores machine-executable instructions capable of being executed by the processor 100, and the processor 100 executes the machine-executable instructions to implement the layer processing method.
Further, the electronic device shown in fig. 6 further includes a bus 102 and a communication interface 103, and the processor 100, the communication interface 103, and the memory 101 are connected through the bus 102.
The Memory 101 may include a Random Access Memory (RAM) and a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used. The bus 102 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 6, but that does not indicate only one bus or one type of bus.
Processor 100 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 100. The Processor 100 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in ram, flash, rom, prom, or eprom, registers, etc. as is well known in the art. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and completes the steps of the method of the foregoing embodiment in combination with the hardware thereof.
The embodiment also provides a machine-readable storage medium, wherein the machine-readable storage medium stores machine executable instructions, and when the machine executable instructions are called and executed by a processor, the machine executable instructions cause the processor to realize the layer processing method.
The layer processing method, the layer processing device, and the electronic device provided in the embodiments of the present invention include a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiments, and specific implementation may refer to the method embodiments, and will not be described herein again.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In addition, in the description of the embodiments of the present invention, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present invention can be understood in specific cases for those skilled in the art.
The functions may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present invention or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that the following embodiments are merely illustrative of the present invention, and not restrictive, and the scope of the present invention is not limited thereto: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. An image layer processing method is characterized by comprising the following steps:
acquiring a plurality of layers to be processed in a target file;
determining an effect adjustment layer and a basic display layer corresponding to the effect adjustment layer from the plurality of layers to be processed; the effect adjusting layer is used for adjusting the display effect of the basic display layer;
and merging the effect adjustment layer and a basic display layer corresponding to the effect adjustment layer to obtain the target file after the layers are merged.
2. The method according to claim 1, wherein the step of obtaining the plurality of layers to be processed in the target file comprises:
acquiring a target file; the target file comprises a plurality of initial image layers and/or initial image layer groups;
preprocessing the target file; the pretreatment comprises at least one of the following modes: unlocking the initial layer; deleting the initial graph layer group with empty content;
and determining the initial layer and/or the initial layer group in the preprocessed target file as the layer to be processed.
3. The method according to claim 1, wherein the effect adjustment layer comprises a first effect adjustment layer and/or a second effect adjustment layer;
the step of determining an effect adjustment layer and a basic display layer corresponding to the effect adjustment layer from the plurality of layers to be processed includes:
searching a mask layer from the plurality of layers to be processed;
if the mask layer is found, determining whether the mask layer is visible or not based on the attribute information of the mask layer;
if so, determining the mask layer as a first effect adjustment layer;
determining the layer to be processed bound by the mask layer as a basic display layer corresponding to the first effect adjustment layer;
searching a layer provided with a preset identifier from the plurality of layers to be processed; the layer provided with the preset identifier comprises a common layer and/or an adjusting layer;
if so, determining whether the found layer is visible or not based on the attribute information of the found layer;
if so, determining the layer provided with the preset identifier as a second effect adjustment layer;
and determining the layer to be processed with the hierarchy lower than the second effect adjustment layer as a basic display layer corresponding to the second effect adjustment layer.
4. The method according to claim 1, wherein the effect adjustment layer comprises a first effect adjustment layer and/or a second effect adjustment layer; the first effect adjustment layer comprises a mask layer; the second effect adjustment layer comprises a layer provided with a preset identifier;
combining the effect adjustment layer and a basic display layer corresponding to the effect adjustment layer, wherein the combining comprises the following steps;
combining the mask layer and the basic display layer corresponding to the mask layer to obtain a combined layer;
and/or (c) and/or,
and merging the layer provided with the preset identification and a basic display layer corresponding to the layer provided with the preset identification.
5. The method according to claim 4, wherein the base display layer corresponding to the mask layer is a graph layer group; the layer group comprises a plurality of common layers;
and merging the mask layer and a basic display layer corresponding to the mask layer, wherein the merging step comprises the following steps of:
generating a copy layer of the mask layer for each common layer in the graph layer group corresponding to the mask layer;
setting the copy layer of the mask layer as the layer of the previous layer of the common layer;
and combining the layer of the previous layer of the common layer with the common layer to obtain a combined layer.
6. The method according to claim 4, wherein the base display layer corresponding to the second effect adjustment layer comprises a plurality of normal layers;
and combining the layer provided with the preset identifier and the basic display layer corresponding to the layer provided with the preset identifier, wherein the combining processing step comprises the following steps:
generating a copy layer of the layer with the preset identifier for each common layer corresponding to the layer with the preset identifier;
setting the copied layer of the layer provided with the preset identifier as a layer at the previous layer of the common layer;
and combining the layer of the previous layer of the common layer with the common layer to obtain a combined layer.
7. The method according to claim 4, wherein the effect adjustment layers include a first effect adjustment layer and a second effect adjustment layer, and before the step of combining the layer provided with the preset identifier and the base display layer corresponding to the layer provided with the preset identifier, the method further includes:
and determining the combined layer as a layer to be processed corresponding to a basic display layer corresponding to the mask layer.
8. An image layer processing apparatus, characterized in that the apparatus comprises:
the layer acquiring module is used for acquiring a plurality of layers to be processed in the target file;
the layer determining module is used for determining an effect adjusting layer and a basic display layer corresponding to the effect adjusting layer from the plurality of layers to be processed; the effect adjusting layer is used for adjusting the display effect of the basic display layer;
and the layer merging module is used for merging the effect adjustment layer and a basic display layer corresponding to the effect adjustment layer to obtain the target file after the layers are merged.
9. An electronic device comprising a processor and a memory, wherein the memory stores machine-executable instructions executable by the processor, and the processor executes the machine-executable instructions to implement the layer processing method according to any one of claims 1 to 7.
10. A machine-readable storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement the layer processing method of any of claims 1-7.
CN202210551318.3A 2022-05-18 2022-05-18 Layer processing method and device and electronic equipment Pending CN115272095A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210551318.3A CN115272095A (en) 2022-05-18 2022-05-18 Layer processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210551318.3A CN115272095A (en) 2022-05-18 2022-05-18 Layer processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN115272095A true CN115272095A (en) 2022-11-01

Family

ID=83759624

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210551318.3A Pending CN115272095A (en) 2022-05-18 2022-05-18 Layer processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115272095A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115796115A (en) * 2023-01-09 2023-03-14 北京芯愿景软件技术股份有限公司 Layout layer grouping method and device, electronic equipment and nonvolatile storage medium
CN117114978A (en) * 2023-10-24 2023-11-24 深圳软牛科技有限公司 Picture cropping and restoring method and device based on iOS and related medium thereof

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115796115A (en) * 2023-01-09 2023-03-14 北京芯愿景软件技术股份有限公司 Layout layer grouping method and device, electronic equipment and nonvolatile storage medium
CN115796115B (en) * 2023-01-09 2023-05-09 北京芯愿景软件技术股份有限公司 Layout layer grouping method and device, electronic equipment and nonvolatile storage medium
CN117114978A (en) * 2023-10-24 2023-11-24 深圳软牛科技有限公司 Picture cropping and restoring method and device based on iOS and related medium thereof
CN117114978B (en) * 2023-10-24 2024-03-29 深圳软牛科技集团股份有限公司 Picture cropping and restoring method and device based on iOS and related medium thereof

Similar Documents

Publication Publication Date Title
CN115272095A (en) Layer processing method and device and electronic equipment
US7113306B1 (en) Image data processing apparatus, medium recording image data set, medium recording image data processing program and image data processing method
JP4398726B2 (en) Automatic frame selection and layout of one or more images and generation of images bounded by frames
EP1298585B1 (en) Image processing method and apparatus
WO2018032783A1 (en) Image processing method and apparatus
US7636477B2 (en) Device for detecting red eye, program therefor, and recording medium storing the program
US20050264833A1 (en) Image retouching apparatus, corresponding image retouching method, and computer program product for image retouching
US20070274573A1 (en) Image processing method and image processing apparatus
JP2006303899A (en) Image processor, image processing system, and image processing program
JP2004334336A (en) Image processor
JPWO2004051575A1 (en) Feature region extraction apparatus, feature region extraction method, and feature region extraction program
JP2002202838A (en) Image processor
US20010004258A1 (en) Method, apparatus and recording medium for generating composite image
JP2008129905A (en) Scrapbook server, its control method and its control program
JP4210316B2 (en) Digital image articulated rendering method
JP2004054751A (en) Image processing system and image processing method
JP2008153796A (en) Server for image synthesis and control method thereof
JP4692102B2 (en) Specify image area
JP3661749B2 (en) PRINT CONTROL DEVICE, PRINT CONTROL METHOD, AND MEDIUM RECORDING PRINT CONTROL PROGRAM
JP2001056867A5 (en)
JP2001056867A (en) Image data processor, medium where image data set is recorded, medium where image data processing program is recorded, and image data processing method
CN112883217B (en) Natural resource data fusion method
JP4507082B2 (en) Catch light synthesis method
KR102045753B1 (en) Image editing processing apparatus that supports transparency processing of the background area of an image and operating method thereof
JPH07255009A (en) Image data management device

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