Skip to content

Commit

Permalink
fix(renderings): Update soft-cover crease emulator color/location
Browse files Browse the repository at this point in the history
ImageMagic changed how some color handling works, plus we added textture
scaling and dropped it in the wrong location. This gets the location and
color handling back, at least for *light* covers. Untested on dark
covers.
  • Loading branch information
alerque committed Mar 23, 2024
1 parent 90085a9 commit bab24f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions rules/functions.mk
Expand Up @@ -256,9 +256,18 @@ define magick_barcode ?=
endef

define magick_crease ?=
-stroke gray95 -strokewidth $(call mmtopx,0.5) \
\( -size $${pagewpx}x$${pagehpx} -background none xc: -draw "line %[fx:$1$(call mmtopx,8)],0 %[fx:$1$(call mmtopx,8)],$${pagehpx}" -blur 0x$(call scale,$(call mmtopx,0.2)) -level "0x40%!" \) \
-compose ModulusAdd -composite
-gravity NorthWest \
\( \
-size $${pagewpx}x$${pagehpx} \
-background none \
xc: \
-stroke grey95 \
-strokewidth $(call mmtopx,0.5) \
-draw "line %[fx:$1$(call mmtopx,8)],0 %[fx:$1$(call mmtopx,8)],$${pagehpx}" \
-blur 0x$(call scale,$(call mmtopx,0.2)) \
-level "0x40%!" \
\) \
-compose Divide -composite
endef

define magick_fray ?=
Expand Down
2 changes: 1 addition & 1 deletion rules/renderings.mk
Expand Up @@ -70,10 +70,10 @@ $(BUILDDIR)/%-pov-$(_front).png: $(BUILDDIR)/%-$(_binding)-printcolor.png $$(geo
$< \
-gravity East \
-crop $${pagewpx}x$${pagehpx}+$${bleedpx}+0! \
-resize $(POVTEXTURESCALE)x \
$(call magick_emulateprint) \
$(and $(filter $(_paperback),$(call parse_binding,$@)),$(call magick_crease,0+)) \
$(call magick_fray) \
-resize $(POVTEXTURESCALE)x \
$@

$(BUILDDIR)/%-pov-$(_back).png: $(BUILDDIR)/%-$(_binding)-printcolor.png $$(geometryfile)
Expand Down

0 comments on commit bab24f0

Please sign in to comment.