Using -distort vs -rotate with a pattern:
Posted: 2017-01-02T11:36:56-07:00
Using IM 7.0.4 on Windows 10 64: I'd like to use one of the IM patterns described at THIS link as a composite mask. I want to fill a rectangle with a tiled "pattern:gray50" by using a "-virtual-pixel tile" setting, and doing a no-op "-distort SRT 0". Unfortunately that changes a perfectly black and white pattern into a dark and light gray pattern. This command creates a pure black and pure white checkerboard of 4x4 squares...
This is what I get by running that command...
The next command, on the other hand, makes a checkerboard of #3E3E3E and #C0C0C0 (approximately 25% and 75%)...
This is the result of running that command...
I know there are several other ways to tile that pattern onto an image but... I want my "distort" operation to handle some other images in a stack in certain ways while only manipulating that "pattern:gray50" according to the "virtual-pixel" and "viewport" settings.
I guess the real question is, is this maybe a bug, or is it expected behavior and I just need to avoid "distort"ing that pattern if I want it to stay pure black and white?
Code: Select all
magick -size 50x50 pattern:gray50 -rotate 0 -scale 400% test_rotate.png
The next command, on the other hand, makes a checkerboard of #3E3E3E and #C0C0C0 (approximately 25% and 75%)...
Code: Select all
magick -size 50x50 pattern:gray50 -virtual-pixel tile -distort SRT 0 -scale 400% test_distort.png
I know there are several other ways to tile that pattern onto an image but... I want my "distort" operation to handle some other images in a stack in certain ways while only manipulating that "pattern:gray50" according to the "virtual-pixel" and "viewport" settings.
I guess the real question is, is this maybe a bug, or is it expected behavior and I just need to avoid "distort"ing that pattern if I want it to stay pure black and white?