Page 2 of 3

Re: Help: mirroring along a diagonal

Posted: 2011-03-21T23:56:36-07:00
by kolorman
Wow!!!!!!!!!

Thanks for yours extensive information at this forum an per email!!

I just try it in this week...

Thanks! Thanks! Thanks!

kolorman

Re: Help: mirroring along a diagonal

Posted: 2011-03-26T15:19:41-07:00
by kolorman
Hi,

I send meanwhile any informations about my projekt - at first: it works!

Thanks at your all

I have any trouble in this time - I send more in the next week!

korlorman

Re: Help: mirroring along a diagonal

Posted: 2011-06-27T03:58:13-07:00
by kolorman
fmw42 wrote: convert zelda3.jpg \( +clone -transpose \) \
\( +clone -sparse-color voronoi '%w,0 white 0,%h black' \) \
-composite \
\( +clone -flop -chop 1x0 \) +append \
\( +clone -flip -chop 0x1 \) -append \
zelda3_kaleidoscope.jpg

Image
Hi fmw42,

you "compress" three convert rows to one convert command, but i less the first command

Code: Select all

convert -size 50x50  xc: +noise Random   -blur 0x5 -emboss 2 source.png
I try to insert this command to yours - unfortunately without a result... :-(

Can you help my for this!?!?

THANKS!!

kolorman

Re: Help: mirroring along a diagonal

Posted: 2011-06-27T08:59:17-07:00
by fmw42
try


convert \( zelda3.jpg +noise Random -blur 0x5 -emboss 2 \) \
\( +clone -transpose \) \
\( +clone -sparse-color voronoi '%w,0 white 0,%h black' \) \
-composite \
\( +clone -flop -chop 1x0 \) +append \
\( +clone -flip -chop 0x1 \) -append \
zelda3_kaleidoscope2.jpg

Image

Re: Help: mirroring along a diagonal

Posted: 2011-06-27T11:49:50-07:00
by kolorman
thanks for your answer - sorry so I´m a IM greenhorn...

thats my current code from python wirh any variables:

#1
command = 'convert -size ' + mask_width + 'x' + mask_height + ' -depth 8 -extract ' + mask_width + 'x' + mask_height + '+' + image_offsetX + '+' + image_offsetY + ' ' + input_file + ' ' + output_extract

I habe a big Picture e.g. and I crop a small image with mask_width, mask_height an an offset in x and y

#2

command = 'convert ' + output_extract + ' -sparse-color voronoi "%w,0 black 0, %h white" ' + output_mask

crate a mask

#3

command = 'convert ' + output_extract + ' \( +clone -transpose \) ' + output_mask + ' -compose Src -composite ' + output_mirror

mirror

#4

if RESIZE_VALUE == 1:
command = 'convert ' + output_mirror + ' -resize 50% ' + output_mirror_small
os.system(command)
else:
output_mirror_small = output_mirror

reseize is this wanted

#5

command = 'convert -rotate 180 ' + output_mirror_small + ' ' + output_rotate

rotate

#6

command = 'convert ' + output_rotate + ' \( +clone -flop -chop 1x0 \) +append \( +clone -flip -chop 0x1 \) -append ' + output_caleidoscope

flip amd mirror

my goal is a convert without to write image-temp-files

thanks
kolorman

Re: Help: mirroring along a diagonal

Posted: 2011-06-27T11:58:49-07:00
by kolorman
... important!!

the left upper corner from the original image is at my convert in the center and its "no 1"

-\6|7/
5-\|/-8
4-/|\-1
-/3|2\

Re: Help: mirroring along a diagonal

Posted: 2011-06-27T12:21:43-07:00
by fmw42
Sorry I do not program Python

Re: Help: mirroring along a diagonal

Posted: 2011-06-27T12:53:54-07:00
by kolorman
thats without variables:

#1
convert -size 412x412 -depth 8 -extract 412x412+10+20 my_input.jpg output_extract.png

#2
convert output_extract.png -sparse-color voronoi "%w,0 black 0, %h white" output_mask.png

#3
convert output_extract.png \( +clone -transpose \) output_mask.png -compose Src -composite output_mirror.png

#4
(if resize)
convert output_mirror.png -resize 50% output_mirror_small.png

#5
convert -rotate 180 output_mirror_small.png output_rotate.png

#6
convert output_rotate.png \( +clone -flop -chop 1x0 \) +append \( +clone -flip -chop 0x1 \) -append output_caleidoscope.png

my_input.jpg is e.g. 1024x768px

thanks!

kolorman

Re: Help: mirroring along a diagonal

Posted: 2011-06-27T13:06:29-07:00
by fmw42
Is there a question?

I don't think the procedure above works for non-square images. So crop it to square first and try that.

Re: Help: mirroring along a diagonal

Posted: 2011-06-27T13:36:40-07:00
by kolorman
hmmm... the output_extract.png is a square image (412x412px) - what is the problem?

my goal is to reduce to write the five temp-file images
* output_extract.png
* output_mask.png
* output_mirror.png
* output_mirror_small.png
* output_rotate.png

so I hope to speed up the complete converting

kolorman

Re: Help: mirroring along a diagonal

Posted: 2011-06-27T14:19:38-07:00
by fmw42
what is wrong with my method provided above?

by the way
convert -size 412x412 -depth 8 -extract 412x412+10+20 my_input.jpg output_extract.png
note -size has been replaced by -define jpeg:size=

see http://www.imagemagick.org/Usage/formats/#jpg_read

also -extract probably should come after your input image.

What version of IM are you using and what platform?

Can you post a link to your example input and output images so others can test your commands if you want someone to help put them into one command line?

Re: Help: mirroring along a diagonal

Posted: 2011-06-27T14:49:48-07:00
by fmw42
try this:


resize=yes
rotate=yes
if [ "$resize" = "yes" ]; then
resizing="-resize 50%"
else
resizing=""
fi
if [ "$rotate" = "yes" ]; then
rotating="-rotate 180"
else
rotating=""
fi
infile="logo:"
convert \( -define jpeg:size=412x412 -depth 8 "$infile" -extract 412x412+10+20 \) \
\( -clone 0 -transpose \) \
\( -clone 0 -sparse-color voronoi "%w,0 black 0, %h white" \) \
\( -clone 0 -clone 1 -clone 2 -compose Src -composite $resizing $rotating \) \
\( -clone 3 -flop -chop 1x0 \) \
-delete 0-2 \
+append \( +clone -flip -chop 0x1 \) -append \
output_caleidoscope.png

Re: Help: mirroring along a diagonal

Posted: 2011-06-28T01:15:08-07:00
by kolorman
hmm... the output file is unfortunately not "correkt"

this is the commad from Python (without resize) and any calcualtet parameters

Code: Select all

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
Ther are files from the "six convert steps":

original image
Image

extract image
Image

result image
Image

Re: Help: mirroring along a diagonal

Posted: 2011-06-28T01:20:40-07:00
by kolorman
I work on a vServer with Ubuntu 10.04 and

Version: ImageMagick 6.5.7-8 2010-12-02 Q16 http://www.imagemagick.org

Thanks

kolorman

Re: Help: mirroring along a diagonal

Posted: 2011-06-28T10:23:10-07:00
by fmw42
What is the correct result? Can you provide a smaller example with the results of my command and from your python