The depth map looks like another channel in Photoshop. With the RGB channels hidden:

How can I apply the blurriness to the photo, according to the depth map, when using the "convert" command?

Code: Select all
convert \( Portrait2.png -resize 576x768 \) \( Portrait2-depth.gif -negate \) -define compose:args=3 -compose blur -composite Portrait2_blur.png
Code: Select all
for /F "usebackq" %%L in (`%IM%convert ^
portrait2-depth.png ^
-format "WW=%%w\nHH=%%h\n" ^
info:`) do set %%L
%IM%convert portrait2.HEIC -resize "%WW%x%HH%^!" p.miff
for /L %%I in (0,10,100) do (
set GRAYPC=%%I
set LZ=000!GRAYPC!
set LZ=!LZ:~-3!
%IMG7%magick ^
portrait2-depth.png ^
^( +clone ^
-fill gray^(!GRAYPC!%%^) -colorize 100 ^
^) ^
-compose Difference -composite ^
p.miff ^
+swap ^
-define compose:args=5 -compose Blur -composite ^
portrait_b_!LZ!.miff
)
%IMG7%magick ^
portrait_b_*.miff ^
^( -clone 0--1 ^
-reverse ^
^) ^
portrait2.gifCode: Select all
# IM 7 on *NIX
convert \
\( Portrait2.png \) \
\( Portrait2-depth.png -resize 3024x4032 -negate \) \
-define compose:args=20 \
-compose blur \
-composite Portrait2_blur.png
How did you extract the depth map layer? can you send me the code?talyPaleAle wrote: 2018-10-05T18:30:43-07:00 @snibo I was able to extract the depth map layer from the image into a PNG file (using libheif). Here it is: https://www.dropbox.com/sh/owbkv37go0vs ... kDSOa?dl=0 The folder contains the original HEIF file, the file converted to PNG (again, using libheif) and the depth map as PNG file.
Could you please show me how the "lens blur" would work here?
Users browsing this forum: Amazon [Bot] and 35 guests