Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-shade matt/marble #245

Open
SimonN opened this issue Sep 30, 2017 · 3 comments
Open

Re-shade matt/marble #245

SimonN opened this issue Sep 30, 2017 · 3 comments
Labels
Tiles Affects Tiles or entire Tilesets. Like physics changes, tile changes affect how levels play.

Comments

@SimonN
Copy link
Owner

SimonN commented Sep 30, 2017

Lix 0.9.0.

Most blocks in matt/marble were shaded with GIMP's bevel tool. This leaves 2 flat rows of pixels on the left, and 2 flat rows of pixels on the top. Blocks with fat edges look sloppy.

Re-shade the blocks.

@SimonN SimonN added the 3-bug label Sep 30, 2017
@SimonN
Copy link
Owner Author

SimonN commented Sep 30, 2017

Here's a script that could work on rectangular blocks: It cuts off the offending rows and upscales the remainder to fill the 2 rows of void.

The script uses ImageMagick's convert and composite.

I have no good idea to automate the diagonal blocks.

#!/bin/bash

xl=$(convert "$1" -format %w info:)
yl=$(convert "$1" -format %h info:)
echo -n "\`$1' is ${xl}x${yl}"

# crop 2 rows from start and 1 row from end, in both directions.
convert "$1" \
    -crop $((xl-3))x$((yl-3))+2+2 \
    -filter Lanczos \
    -adaptive-resize $((xl-1))x$((yl-1))\! \
    oneTooSmall.png

# crop only 2 rows from start, this will be our canvas
convert "$1" \
    -crop $((xl-2))x$((yl-2)) \
    -scale ${xl}x${yl}\! \
    hardScaled.png

# print the earlier pic on the canvas
composite oneTooSmall.png hardScaled.png "$1"

rm oneTooSmall.png hardScaled.png

xl=$(convert "$1" -format %w info:)
yl=$(convert "$1" -format %h info:)
echo ", now ${xl}x${yl}."

@SimonN SimonN removed the 3-bug label Sep 30, 2017
@SimonN SimonN added the 3-bug label Dec 23, 2017
@SimonN SimonN added Tiles Affects Tiles or entire Tilesets. Like physics changes, tile changes affect how levels play. and removed 3-bug labels Jan 21, 2018
@SimonN
Copy link
Owner Author

SimonN commented Mar 8, 2018

Example: Cutting off two rows from the left and top will improve the big Marble blocks.

Example to cut off two rows of pixels

@SimonN
Copy link
Owner Author

SimonN commented Aug 12, 2018

Better script: Cut hardScaled.png such that it keeps the bottom dark parts:

#!/bin/bash
# https://github.com/SimonN/LixD/issues/245

xl=$(convert "$1" -format %w info:)
yl=$(convert "$1" -format %h info:)
echo -n "\`$1' is ${xl}x${yl}"

# crop 2 rows from start and 1 row from end, in both directions.
convert "$1" \
    +repage \
    -crop $((xl-3))x$((yl-3))+2+2 \
    -filter Lanczos \
    -adaptive-resize $((xl-1))x$((yl-1))\! \
    oneTooSmall.png

# crop only 2 rows from start, this will be our canvas
convert "$1" \
    +repage \
    -crop $((xl-2))x$((yl-2))+2+2 \
    -scale ${xl}x${yl}\! \
    hardScaled.png

# print the earlier pic on the canvas
composite oneTooSmall.png hardScaled.png "$1"

rm oneTooSmall.png hardScaled.png

xl=$(convert "$1" -format %w info:)
yl=$(convert "$1" -format %h info:)
echo ", now ${xl}x${yl}."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tiles Affects Tiles or entire Tilesets. Like physics changes, tile changes affect how levels play.
Projects
None yet
Development

No branches or pull requests

1 participant