Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
[tagged]
layers for variants.PaintTool SAIv2
and Clip Studio Paint
.For my art workflow, I typically make a bunch variation layers and also need to apply mosaics to all of them. As a manual process, exporting every variant can take several minutes, with lots of clicking everywhere to turn layers on and off (potentially missing layers by accident) and then adding mosaics can be another 10 or 20 minutes of extra work. If I find I need to change something in my pictures and export again, I have to repeat this whole ordeal. This script puts this export process on the order of seconds, saving me a lot of time and pain.
pip install psd-export
to install the script.psd-export
to export any PSD files in the current directory.psd-export --help
for more command line arguments.pip install setuptools wheel cython numpy
pip install -e .
python setup.py build_ext --inplace
[]
to the names of layers that you want as part of an exported picture.
scene [1]
, which will be ignored.[blur 50]
the tag name will be blur
, and 50
is an argument to blur
.foreground [1]
and a separate layer named background [1]
scene [1][2]
@
in the name will be treated as secondary tags.@
is the tag name, and text after the @
is the exclusion group.
[jp@]
, [jp@text]
[1]
, [thing@]
[jp@text]
, and [en@text]
, then what will be exported is 1
, 1-thing
, 1-thing-jp
, 1-thing-en
, 1-jp
, 1-en
[jp@text]
and [en@text]
share the same exclusion group text
, they will never be enabled together.[2]
for example, the whole set of combinations would be exported again but with 2
instead of 1
#
to set the ignore flag, for example [#censor]
[#censor 50]
pass-through
, otherwise it may blend with transparent black pixels if the filter is over a transparent part of a group. The blur and motion blur filters apply to alpha as well, so they should behave as expected in isolated groups.[#censor][#blur]
will apply a mosaic, and then a blur on top of that mosaic.[censor mosaic_factor apply_to_alpha]
mosaic_factor
argument is omitted, then it is defaulted to 100, which means 1/100th the smallest dimension, (or 4 pixels, whichever is larger) in order to be Pixiv compliant.apply_to_alpha
defaults to False. Any value is treated as True.[censor@]
, so you can have censored and uncensored outputs.[blur size]
size
argument defaults to 50 if omitted.[#blur 8]
for example.[motion-blur angle size]
angle
is in degrees, starting from horizontal to the right; Default 0.size
defaults to 50.[#motion-blur 45 20]
In your own script:
# my-export.py
from psd_export import (export, filters, util, blendfuncs)
import numpy as np
my_arg1_default = 1.0
# Register the filter with this decorator:
@filters.filter('my-filter')
# Only positional arguments work right now. The result of this function replaces the destination color and alpha.
def some_filter(color_dst, color_src, alpha_dst, alpha_src, arg1=None, arg2=100, *_):
# Cast arguments to your desired types, as they will come in as strings.
if arg1 is None:
arg1 = my_arg1_default
arg1 = float(arg1)
# Manipulate color and alpha numpy arrays, in-place if you want.
color = np.subtract(arg1, color, out=color)
color = blendfuncs.lerp(color_dst, color, alpha_src)
# Always return the same shaped arrays as a tuple:
return color, alpha
if __name__ == '__main__':
# Add your own command line arguments if needed.
export.arg_parser.add_argument('--my-arg1', default=my_arg1_default, type=float,
help='Set the arg1 default parameter.')
args = export.arg_parser.parse_args()
my_arg1_default = args.my_arg1
export.main()
Apply it to a layer in your PSD, for example:
[my-filter 20.4]
or [#my-filter]
, etc.
In the layers below, there are 2 primary tags and 3 secondary tags (with two unique exclusion groups):
Primary tags: 1
, 2
Secondary tags: jp
, en
, censor
Exclusion groups: text
, <empty>
Groups with primary tags will be exported again even if the secondary tag does not exist under that group! This keeps the exported folders uniformly sized for publishing, so different folders may appear to have duplicate outputs.
Example layer configuration in SAI:
Example output from script, showing every valid combination:
Folder after exporting everything:
Example of a layer with the tag [censor@]
(the layer does not need to be set to visible before exporting):
After exporting:
Blendmode | Status |
---|---|
Normal | Pass |
Multiply | Pass |
Screen | Pass |
Overlay | Pass |
Linear Burn (Shade) | Pass |
Linear Dodge (Shine) | Pass |
Linear Light (Shade/Shine) | Pass |
Color Burn (Burn) | Pass |
Color Dodge (Dodge) | Pass |
Vivid Light (Burn/Dodge) | Pass |
Soft Light | Pass |
Hard Light | Pass |
Pin Light | Pass |
Hard Mix | Small precision error for near-black colors, can look slightly different from SAI |
Darken | Pass |
Lighten | Pass |
Darken Color | Pass |
Lighten Color | Pass |
Difference | Pass |
Exclude | Pass |
Subtract | Pass |
Divide | Pass |
Hue | Pass |
Saturation | Pass |
Color | Pass |
Luminosity | Pass |
[TS] Linear Burn (Shade) | Pass |
[TS] Linear Dodge (Shine) | Pass |
[TS] Linear Light (Shade/Shine) | Pass |
[TS] Color Burn (Burn) | Small precision error for near-black colors, can look slightly different from SAI |
[TS] Color Dodge (Dodge) | Pass |
[TS] Vivid Light (Burn/Dodge) | Pass |
[TS] Hard Mix | Small precision error for near-black colors, can look slightly different from SAI |
[TS] Difference | Pass |
psd-tools
):
FAQs
Fast exporting of PSDs with [tagged] layers for variants.
We found that psd-export demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.