Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit 2b38f06

Browse files
authored
Merge pull request #21 from kwcckw/dev
Updated parameters.
2 parents 81f1e8c + 564b4e8 commit 2b38f06

File tree

1 file changed

+39
-55
lines changed

1 file changed

+39
-55
lines changed

shabbypipeline.py

+39-55
Original file line numberDiff line numberDiff line change
@@ -15,51 +15,51 @@ def get_pipeline():
1515
# Dithering.dither_type can be 'ordered' for ordered dithering or another string for floyd-steinberg dithering
1616
dithering_dither_type = random.choice(["ordered", "floyd-steinberg"])
1717
# Dithering.order determines the dimensions of the threshold map
18-
dithering_order = random.choice(range(1,10))
18+
dithering_order = random.choice(range(3,10))
1919

2020
# InkBleed.intensity_range is a tuple with bounds for bleed intensity to be selected from
21-
inkbleed_intensity_range = (0.1, 0.2)
21+
inkbleed_intensity_range = (0.1, 0.4)
2222
# InkBleed.color_range is a tuple with bounds for color noise
23-
inkbleed_color_range = (0, 224)
23+
inkbleed_color_range = (0, 32)
2424
# InkBleed.kernel_size determines the radius of the bleed effect
25-
inkbleed_kernel_size = (5, 5)
25+
inkbleed_kernel_size = random.choice([(7,7), (5, 5), (3,3)])
2626
# InkBleed.severity determines significance of bleed effect
2727
inkbleed_severity=(0.4, 0.6)
2828

2929
# BleedThrough.intensity_range is a tuple with bounds for bleed intensity to be selected from
3030
bleedthrough_intensity_range=(0.1, 0.2)
3131
# BleedThrough.color_range is a tuple with bounds for color noise
32-
bleedthrough_color_range=(0, 224)
32+
bleedthrough_color_range=(32, 224)
3333
# BleedThrough.ksize is a tuple of height/width pairs for sampling kernel size
3434
bleedthrough_ksize=(17, 17)
3535
# BleedThrough.sigmaX is the standard deviation of the kernel along the x-axis
3636
bleedthrough_sigmaX=0
3737
# BleedThrough.alpha is the intensity of the bleeding effect, recommended 0.1-0.5
38-
bleedthrough_alpha=0.3
38+
bleedthrough_alpha=random.uniform(0.05,0.1)
3939
# BleedThrough.offsets is a pair of x and y distances to shift the bleed with
4040
bleedthrough_offsets=(10, 20)
4141

4242
# Letterpress.n_samples is a tuple determining how many points to generate per cluster
43-
letterpress_n_samples=(100, 200)
43+
letterpress_n_samples=(100, 300)
4444
# Letterpress.n_clusters is a tuple determining how many clusters to generate
45-
letterpress_n_clusters=(500, 1000)
45+
letterpress_n_clusters=(300, 400)
4646
# Letterpress.std_range is a pair of ints determining the std deviation range in each blob
47-
letterpress_std_range=(500, 500)
47+
letterpress_std_range=(500, 3000)
4848
# Letterpress.value_range determines values that points in the blob are sampled from
49-
letterpress_value_range=(200, 255)
49+
letterpress_value_range=(150, 224)
5050
# Letterpress.value_threshold_range is the minimum pixel value to enable the effect (e.g. 128)
51-
letterpress_value_threshold_range=(128, 128)
51+
letterpress_value_threshold_range=(96, 128)
5252
# Letterpress.blur enables blur in the noise mask
5353
letterpress_blur=1
5454

5555
# LowInkLines.count_range is a pair determining how many lines should be drawn
56-
lowinkrandomlines_count_range = (5, 10)
57-
lowinkperiodiclines_count_range = (2, 5)
56+
lowinkrandomlines_count_range = (3, 12)
57+
lowinkperiodiclines_count_range = (1, 2)
5858
# LowInkLines.use_consistent_lines is false if we should vary the width and alpha of lines
5959
lowinkrandomlines_use_consistent_lines=random.choice([True, False])
6060
lowinkperiodiclines_use_consistent_lines=random.choice([True, False])
6161
# LowInkPeriodicLines.period_range is a pair determining how wide the gap between lines can be
62-
lowinkperiodiclines_period_range=(10, 30)
62+
lowinkperiodiclines_period_range=(16, 32)
6363

6464
# PaperFactory.texture_path is the directory to pull textures from
6565
paperfactory_texture_path = "./paper_textures"
@@ -75,7 +75,7 @@ def get_pipeline():
7575
brightnesstexturize_deviation = 0.03
7676

7777
# Brightness.range is a pair of floats determining the brightness delta
78-
brightness_range = (0.8, 1.4)
78+
brightness_range = (0.9, 1.1)
7979

8080
# PageBorder.side determines the page edge of the effect
8181
pageborder_side = random.choice(["left", "top", "bottom", "right"])
@@ -95,7 +95,7 @@ def get_pipeline():
9595
pageborder_value = (32, 150)
9696

9797
# DirtyRollers.line_width_range determines the width of roller lines
98-
dirtyrollers_line_width_range = (8, 12)
98+
dirtyrollers_line_width_range = (2, 32)
9999
# DirtyRollers.scanline_type changes the background of lines
100100
dirtyrollers_scanline_type = 0
101101

@@ -104,7 +104,7 @@ def get_pipeline():
104104
# LightingGradient.direction indicates the rotation degree of the light strip
105105
lightinggradient_direction = None
106106
# LightingGradient.max_brightness and LightingGradient.min_brightness set bounds for how much brightness change will happen
107-
lightinggradient_max_brightness = 255
107+
lightinggradient_max_brightness = 196
108108
lightinggradient_min_brightness = 0
109109
# LightingGradient.mode is linear or gaussian depending on how light should decay
110110
lightinggradient_mode = random.choice(["linear_dynamic", "linear_static", "gaussian"])
@@ -139,7 +139,7 @@ def get_pipeline():
139139
# Markup.length_range determines the relative length of the drawn effect
140140
markup_length_range=(0.5, 1)
141141
# Markup.thickness_range determines the thickness of the drawn effect
142-
markup_thickness_range=(1, 3)
142+
markup_thickness_range=(1, 2)
143143
# Markup.type determines the style of effect
144144
markup_type=random.choice(["strikethrough", "crossed", "highlight", "underline"])
145145
# Markup.color is the color of the ink used to markup
@@ -149,86 +149,70 @@ def get_pipeline():
149149
# Markup.single_word_mode determines whether to draw across multiple words
150150
markup_single_word_mode=random.choice([True, False])
151151
# Markup.repetitions determines the number of times the effect is drawn
152-
markup_repetitions=random.randint(1,5)
152+
markup_repetitions=random.randint(1,2) if markup_type == "highlight" else 1
153153

154154
# PencilScribbles.size_range determines the size of scribbles to draw
155-
pencilscribbles_size_range=(250, 400)
155+
pencilscribbles_size_range=(100, 700)
156156
# PencilScribbles.count_range determines how many scribbles to draw
157-
pencilscribbles_count_range=(1, 10)
157+
pencilscribbles_count_range=(1, 6)
158158
# PencilScribbles.stroke_count_range determines how many strokes per scribble
159-
pencilscribbles_stroke_count_range=(3, 6)
159+
pencilscribbles_stroke_count_range=(1, 1)
160160
# PencilScribbles.thickness_range determines how thick strokes are
161161
pencilscribbles_thickness_range=(2, 6)
162162
# PencilScribbles.brightness_change is the brightness value of each stroke
163-
pencilscribbles_brightness_change=random.randint(0,128)
163+
pencilscribbles_brightness_change=random.randint(64,224)
164164

165165
# BindingsAndFasteners.overlay_types can be min, max, or mix
166-
bindingsandfasteners_overlay_types = random.choice([
167-
"min", "max", "mix", "normal",
168-
"lighten", "darken", "addition", "subtract",
169-
"difference", "screen", "dodge", "multiply",
170-
"divide", "hard_light", "grain_extract",
171-
"grain_merge", "overlay"
172-
])
166+
bindingsandfasteners_overlay_types = "darken"
173167
# BindingsAndFasteners.foreground is the path to fg image or the image itself
174168
bindingsandfasteners_foreground = None
175169
# BindingsAndFasteners.effect_type is "punch_holes", "binding_holes", or "clips"
176170
bindingsandfasteners_effect_type = random.choice(["punch_holes", "binding_holes", "clips"])
177171
# BindingsAndFasteners.ntimes gives how many fg images to draw
178-
bindingsandfasteners_ntimes = 3
172+
bindingsandfasteners_ntimes = (10,20) if bindingsandfasteners_effect_type == "binding_holes" else (2,3)
179173
# BindingsAndFasteners.nscales is the scale of the fg image size
180-
bindingsandfasteners_nscales = (1,1)
174+
bindingsandfasteners_nscales = (0.9,1)
181175
# BindingsAndFasteners.edge gives the edge to place the images on
182-
bindingsandfasteners_edge = random.choice(["left", "top", "bottom", "right"])
176+
bindingsandfasteners_edge = "random"
183177
# BindingsAndFasteners.edge_offset is how far from the page edge to draw
184-
bindingsandfasteners_edge_offset = 50
178+
bindingsandfasteners_edge_offset = (10,50)
185179

186180
# BadPhotoCopy.mask is a mask of noise to generate the effect with
187181
badphotocopy_mask=None
188182
# BadPhotoCopy.noise_type determines which mask pattern to use
189-
badphotocopy_noise_type=random.randint(1,8)
183+
badphotocopy_noise_type=-1 # -1 is random
190184
# BadPhotoCopy.noise_side determines where to add noise
191-
badphotocopy_noise_side=random.choice([
192-
"random",
193-
"left",
194-
"right",
195-
"top",
196-
"bottom",
197-
"top_left",
198-
"top_right",
199-
"bottom_left",
200-
"bottom_right",
201-
])
185+
badphotocopy_noise_side="random"
202186
# BadPhotoCopy.noise_iteration determines how many times to apply noise in the mask
203-
badphotocopy_noise_iteration=(1, 1)
187+
badphotocopy_noise_iteration=(1, 2)
204188
# BadPhotoCopy.noise_size determines the scale of noise in the mask
205-
badphotocopy_noise_size=(1, 1)
189+
badphotocopy_noise_size=(1, 2)
206190
# BadPhotoCopy.noise_value determines the intensity of the noise
207-
badphotocopy_noise_value=(30, 60)
191+
badphotocopy_noise_value=(128, 196)
208192
# BadPhotoCopy.noise_sparsity determines the sparseness of noise
209-
badphotocopy_noise_sparsity=(0.4, 0.6)
193+
badphotocopy_noise_sparsity=(0.3, 0.6)
210194
# BadPhotoCopy.noise_concentration determines the concentration of noise
211-
badphotocopy_noise_concentration=(0.4, 0.6)
195+
badphotocopy_noise_concentration=(0.1, 0.5)
212196
# BadPhotoCopy.blur_noise determines whether or or not to add blur
213197
badphotocopy_blur_noise=random.choice([True,False])
214198
# BadPhotoCopy.blur_noise_kernel gives the dimensions for the noise kernel
215-
badphotocopy_blur_noise_kernel=(5, 5)
199+
badphotocopy_blur_noise_kernel=random.choice([(3, 3), (5, 5), (7, 7)])
216200
# BadPhotoCopy.wave_pattern enables the wave pattern in the noise mask
217201
badphotocopy_wave_pattern=random.choice([True,False])
218202
# BadPhotoCopy.edge_effect adds the Sobel edge effect to the noise mask
219203
badphotocopy_edge_effect=random.choice([True,False])
220204

221205
# Gamma.range is an interval from which to sample a gamma shift
222-
gamma_range = (0.5, 1.5)
206+
gamma_range = (0.8, 1.2)
223207

224208
# Geometric.scale is a pair determining how to scale the image
225209
geometric_scale = (1, 1)
226210
# Geometric.translation is a pair determining where to translate the image
227211
geometric_translation = (0, 0)
228212
# Geometric.fliplr flips the image left and right
229-
geometric_fliplr = random.choice([0,1])
213+
geometric_fliplr = 0
230214
# Geometric.flipud flips the image up and down
231-
geometric_flipud = random.choice([0,1])
215+
geometric_flipud = 0
232216
# Geometric.crop is a tuple of four points giving the corners of a crop region
233217
geometric_crop = ()
234218
# Geometric.rotate_range is a pair determining the rotation angle sample range

0 commit comments

Comments
 (0)