Thanks for this detailed explanation. I really appreciate it.
I found a solution to make the DepthMap image that I get from AutoDepth to make as the same size as original image. I use the resize command so that I make both images the same dimensions, that is, I change the DepthMap image according to the original image. That works nicely. I am very happy because it works for every image which I converted to 3D stereo wiggle. And I play with phots every day.
Here is the sampe code about resize (Windows BAT file)
REM Make AutoDepthImage from Image Down commands depends od DepthMap Image
gmic -i[0] bs.png -fx_tk_autodepth -blur[-1] 2,2,1 -normalize 0,255 -o aro/AutoDepth_blur_negate.png
REM Resize AutoDepthImage to Image
gmic -i[0] bs.png -i[1] aro/AutoDepth_blur_negate.png +resize[-1] [0],[0],1,3,4 -o[-1] aro/00_astero_AutoDepth_blur_negate.png -display[-1]
Here is a full working code. (windows BAT file: Make_3D_stereo_wiggle_from_one_photo.bat)
REM Makes 3D stereo wiggle GIF animated image from just one photo given as an argumet to Command Line
REM Make_3D_stereo_wiggle_from_one_photo.bat
REM in GMIC folder make ARO folder.
gmic %1 -o bs.png
gmic -i bs.png -display
REM LINEART edges from a photo cl_lineart 0,0,2,1,15,15,1,0,6,2,2,0,0,0,50,50 cl_lineart 0,0,2,1,15,15,1,5,6,1,2,0,0,0,50,50
REM Artistic lineart
REM Custom command cl_lineart.gmic must be in GMIC directory
gmic -i %1 cl_lineart.gmic cl_lineart 0,0,2,1,15,15,1,0,6,2,2,0,0,0,50,50 +cut 5%%,95%% normalize 0,255 -o %1_cl_lineart.png -display
REM gmic -i %1 cl_lineart.gmic cl_lineart_prerelease 0,0,2,1,15,15,1,5,6,1,2,0,0,0,50,50 normalize 0,255 -o aro/%1_cl_lineart.png -display
REM Custom command cl_lineart.gmic must be in GMIC directory
gmic -input[0] %1 cl_lineart.gmic cl_lineart_prerelease 0,0,2,1,15,15,1,5,6,1,2,0,0,0,50,50 normalize 0,255 -o aro/%1_cl_lineart.png -display -input[1] %1 fx_stamp[1] 1,50,0,0,0,0,1,0,50,50 blend[0,1] hardlight -normalize 0,255 -o %1_strip_hardlight.png -display
REM Edges from photo fx_edges
gmic -i %1 fx_edges 0,9,0,0,50,50 normalize 0,255 -o aro/%1_fx_edges.png -display
REM Makes Black and White from photo
gmic -i[0] %1 -luminance -gradient[-1] xy,1 -a[-2,-1] c -norm[-1] -negative[-1] -unsharp[-1] 20%% -cut[-1] 0,255 -normalize 0,255 -o aro/%1_crtez.png -display
REM -fx_dreamy_watercolour
gmic -i %1 -fx_dreamy_watercolour 0,0.3,40,60,0,1,50,0,10,2,1,1,0.5,10,0,0,7,1,3,1,1,1,1,1,11,1,25,5,1,10,1,0,0,1,0.5,0,8,1,0,128,128,128,0.5,1,8,0.2,1,1,0,27,0.75,0,1,20,40,40,1,2,1.25,0,2,1,27,1 -o aro/%1_fx_dreamy_watercolour.png -display
REM -cl_comic Comic Book
gmic -i %1 +cl_comic 6,1,0,1,1,15,15,1,10,20,6,2,4,0,0,0,1,0,50,50 normalize 0,255 -o aro/%1_Comic_Book.png -display
REM hardsketch BW fx_hardsketchbw
gmic -i %1 -fx_hardsketchbw 272,50,0.68,0.115,0,0,4,0,50,50 -normalize 0,255 -o aro/%1_hardsketchbw.png -display
REM Makes AutoDepthImage from Image Comands below depends of DepthMap Image from AutoDepth command
gmic -i[0] bs.png -fx_tk_autodepth -blur[-1] 2,2,1 -normalize 0,255 -o aro/AutoDepth_blur_negate.png
REM Resize AutoDepthImage to Image
gmic -i[0] bs.png -i[1] aro/AutoDepth_blur_negate.png +resize[-1] [0],[0],1,3,4 -o[-1] aro/00_astero_AutoDepth_blur_negate.png -display[-1]
REM Makes RED Blue glasses 3D photo
gmic -i bs.png fx_tk_make3D 0,20,0,20,0,0,0,0,0,0,0,0,0,1.2,25,1,0,1,0,0,0,2,200 -o aro/%1_make3D.png -display
REM Displace 8 pictures according DeptMap image for GIF animation
gmic -i[0] bs.png -i[1] aro/00_astero_AutoDepth_blur_negate.png -fx_WarpTest 90,128,60,2,0 -normalize 0,255 -o aro/astro_anim0001.png
gmic -i[0] bs.png -i[1] aro/00_astero_AutoDepth_blur_negate.png -fx_WarpTest 135,85,60,2,0 -normalize 0,255 -o aro/astro_anim0002.png
gmic -i[0] bs.png -i[1] aro/00_astero_AutoDepth_blur_negate.png -fx_WarpTest 155,45,60,2,0 -normalize 0,255 -o aro/astro_anim0003.png
gmic -i[0] bs.png -i[1] aro/00_astero_AutoDepth_blur_negate.png -fx_WarpTest 180,01,60,2,0 -normalize 0,255 -o aro/astro_anim0004.png
gmic -i[0] bs.png -i[1] aro/00_astero_AutoDepth_blur_negate.png -fx_WarpTest 225,-45,60,2,0 -normalize 0,255 -o aro/astro_anim0005.png
gmic -i[0] bs.png -i[1] aro/00_astero_AutoDepth_blur_negate.png -fx_WarpTest 270,-90,60,2,0 -normalize 0,255 -o aro/astro_anim0006.png
gmic -i[0] bs.png -i[1] aro/00_astero_AutoDepth_blur_negate.png -fx_WarpTest 295,-109,60,2,0 -normalize 0,255 -o aro/astro_anim0007.png
gmic -i[0] bs.png -i[1] aro/00_astero_AutoDepth_blur_negate.png -fx_WarpTest 90,-128,60,2,0 -normalize 0,255 -o aro/astro_anim0008.png
REM Crop black borders on images.
gmic -i aro/astro_anim0001.png crop 3%%,3%%,97%%,97%%,0 -o aro/astro_animC0001.png
gmic -i aro/astro_anim0002.png crop 3%%,3%%,97%%,97%%,0 -o aro/astro_animC0002.png
gmic -i aro/astro_anim0003.png crop 3%%,3%%,97%%,97%%,0 -o aro/astro_animC0003.png
gmic -i aro/astro_anim0004.png crop 3%%,3%%,97%%,97%%,0 -o aro/astro_animC0004.png
gmic -i aro/astro_anim0005.png crop 3%%,3%%,97%%,97%%,0 -o aro/astro_animC0005.png
gmic -i aro/astro_anim0006.png crop 3%%,3%%,97%%,97%%,0 -o aro/astro_animC0006.png
gmic -i aro/astro_anim0007.png crop 3%%,3%%,97%%,97%%,0 -o aro/astro_animC0007.png
gmic -i aro/astro_anim0008.png crop 3%%,3%%,97%%,97%%,0 -o aro/astro_animC0008.png
REM Make GIF wiggle animation 3D HERE is the result of the operation
REM ffmpeg must be in GMIC folder.
ffmpeg -f image2 -framerate 6 -i aro/astro_animC%%04d.png -loop -0 %1_GIF_anim.gif
ffmpeg -f image2 -framerate 6 -i aro/astro_animC%%04d.png -loop -0 aro/%1_GIF_anim.gif
ffmpeg -f image2 -framerate 6 -i aro/astro_animC%%04d.png -loop -0 aro/astero_ffmpeg_GIF_anim.gif
REM "OPEN W:\GMIC\aro to see results"
I hope you will play with this code and enjoy in it.
Put an photo my_photo.jpg into GMIC folder and make new folder named aro
In CLI type
Make_3D_stereo_wiggle_from_one_photo.bat my_photo.jpg
File contains 5 commands which convert photo into arts:
cl_lineart
fx_edges
-luminance -gradient[-1] xy,1 -a[-2,-1] c -norm[-1] -negative[-1] -unsharp[-1] 20%% -cut[-1] 0,255 -normalize 0,255
fx_dreamy_watercolour
fx_hardsketchbw
fx_tk_autodepth
fx_tk_make3D
fx_WarpTest
crop
resize
Make GIF anim using ffmpeg.
ffmpeg -f image2 -framerate 6 -i aro/astro_animC%%04d.png -loop -0 %1_GIF_anim.gif
Cheers!