Page 3 of 3

Re: Help: mirroring along a diagonal

Posted: 2011-06-28T13:09:30-07:00
by kolorman
I´m not sure so I understand your question....

I use the commands from anthony viewtopic.php?f=1&t=18337#p70354 with a small adaption...

I crop from a big image (original image) a smaller square image (extract image) with a offset to x and y.

I crop this image to a triangle from top-left-corner -> top-right-corner -> upper-right-corner and return.

This triangle come to "field 1" viewtopic.php?f=1&t=18337&start=15#p73850

mirror this to field 2

mirror square field to 3+4 or 7+8

mirror a last one...

have the extract image e.g. 647x647px so have the result image the double width and height (1294x1294px)

thats all... ;-)

Re: Help: mirroring along a diagonal

Posted: 2011-06-28T15:04:21-07:00
by fmw42
then what is the question or problem? why do you say your result is not correct? can you make a correct result in python? if so, then provide an example image from python and one from IM command line to show us the difference.

Re: Help: mirroring along a diagonal

Posted: 2011-06-28T18:47:12-07:00
by fmw42
see my note above. but you can try swapping the black and white as you reversed it from what Anthony's example had.
convert \( -define jpeg:size=646.875x646.875 -depth 8 test2_orig.jpg -extract 646.875x646.875+17.1875+301.5625 \) \
\( -clone 0 -transpose \) \
\( -clone 0 -sparse-color voronoi "%w,0 black 0, %h white" \) \
\( -clone 0 -clone 1 -clone 2 -compose Src -composite -rotate 180 \) \
\( -clone 3 -flop -chop 1x0 \) \
-delete 0-2 +append \
\( +clone -flip -chop 0x1 \) -append \
caleidoscope_test2_orig.jpg.png
try

convert \( -define jpeg:size=646.875x646.875 -depth 8 test2_orig.jpg -extract 646.875x646.875+17.1875+301.5625 \) \
\( -clone 0 -transpose \) \
\( -clone 0 -sparse-color voronoi "%w,0 white 0, %h black" \) \
\( -clone 0 -clone 1 -clone 2 -compose Src -composite -rotate 180 \) \
\( -clone 3 -flop -chop 1x0 \) \
-delete 0-2 +append \
\( +clone -flip -chop 0x1 \) -append \
caleidoscope_test2_orig.jpg.png

Does that help?

Also try without the -rotate 180?

Re: Help: mirroring along a diagonal

Posted: 2011-06-28T23:54:52-07:00
by kolorman
What a pity... :-(

your command is not the soution - the result looks like a "patchwork", is to big and have black stripes

Her come the the commands like "anthony-version" from the Python thats bring a corret result:

Code: Select all

convert -size 646.875x646.875 -depth 8 -extract 646.875x646.875+17.1875+301.5625 test2_orig.jpg extract_test2_orig.jpg.png
convert extract_test2_orig.jpg.png -sparse-color voronoi "%w,0 black 0, %h white" mask_test2_orig.jpg.png
convert extract_test2_orig.jpg.png \( +clone -transpose \) mask_test2_orig.jpg.png -compose Src -composite mirror_test2_orig.jpg.png
convert -rotate 180 mirror_test2_orig.jpg.png rotate_test2_orig.jpg.png
convert rotate_test2_orig.jpg.png \( +clone -flop -chop 1x0 \) +append \( +clone -flip -chop 0x1 \) -append caleidoscope_test2_orig.jpg.png
you can test this with http://www.e-spin.de/privat/test2_orig.jpg and look at the result in viewtopic.php?f=1&t=18337&start=15#p73872

Re: Help: mirroring along a diagonal

Posted: 2011-06-29T00:08:05-07:00
by kolorman
fmw42 wrote: convert \( -define jpeg:size=646.875x646.875 -depth 8 test2_orig.jpg -extract 646.875x646.875+17.1875+301.5625 \) \
\( -clone 0 -transpose \) \
\( -clone 0 -sparse-color voronoi "%w,0 white 0, %h black" \) \
\( -clone 0 -clone 1 -clone 2 -compose Src -composite -rotate 180 \) \
\( -clone 3 -flop -chop 1x0 \) \
-delete 0-2 +append \
\( +clone -flip -chop 0x1 \) -append \
caleidoscope_test2_orig.jpg.png
I test the first row

convert \( -define jpeg:size=646.875x646.875 -depth 8 test2_orig.jpg -extract 646.875x646.875+17.1875+301.5625 \) extract-test.png

=> extract-test.png is the same as test2_orig.jpg ??

Re: Help: mirroring along a diagonal

Posted: 2011-06-29T09:53:28-07:00
by fmw42
Using zelda3.png for testing, I get exactly the same thing from your commands and mine as follows:

yours:


infile="zelda3.png"
convert $infile -sparse-color voronoi "%w,0 black 0, %h white" zelda3_mask.png
convert $infile \( +clone -transpose \) zelda3_mask.png -compose Src -composite zelda3_mirror.png
convert zelda3_mirror.png -rotate 180 zelda3_rotate.png
convert zelda3_rotate.png \( +clone -flop -chop 1x0 \) +append \( +clone -flip -chop 0x1 \) -append zelda3_caleidoscope.png

Image


Mine:

infile="zelda3.png"
convert $infile \
\( +clone -transpose \) \
\( +clone -sparse-color voronoi "%w,0 black 0, %h white" \) \
-composite -rotate 180 \
\( +clone -flop \) +append \
\( +clone -flip \) -append \
zelda3_kaleidoscope_180.png

Image

P.S. Why are your images ending in both .jpg.png


This reproduces your result with your image:


convert \( -size 646.875x646.875 -depth 8 -extract 646.875x646.875+17.1875+301.5625 test2_orig.jpg \) \
\( +clone -transpose \) \
\( +clone -sparse-color voronoi "%w,0 black 0, %h white" \) \
-composite -rotate 180 \
\( +clone -flop \) +append \
\( +clone -flip \) -append \
test2_orig_sub_kaleidoscope_180.jpg

Re: Help: mirroring along a diagonal

Posted: 2011-06-29T11:48:52-07:00
by kolorman
Wow - this works fine!!!!!!

I dont understand why my picture have 1293x1293px an your command produce 1294x1294px...

I shold round the values to integer 646.875 => 647...

the ".jpg.png" extension is a small "bug" at my python script :-(

Thank you very mutch!!!!!!!!!!!!!!!!!!! for your help - I wish, I can revanche to you...

kolorman

Berlin, Germany

Re: Help: mirroring along a diagonal

Posted: 2011-06-29T14:20:28-07:00
by fmw42
Based upon all this testing and Anthony's concept, I have embellished it and made a new script, kaleidoscopic, at the link below. Note this is totally different from my kaleidoscope script.