1

From this code:

   \documentclass[12pt]{article}
    \usepackage{tikz}
    \usepackage{tikzpagenodes}
    \usetikzlibrary{arrows, shapes, positioning, shadows.blur}
    \usepackage[most]{tcolorbox}
    \usepackage[left=0.1cm, right=0.1cm, top=0.1cm, bottom=0.1cm]{geometry}
\definecolor{titleBack}{RGB}{1, 28, 115}

\begin{document}
\tcbset{colback=titleBack, arc=0mm}
\begin{tcolorbox}
\begin{minipage}{4.5cm}
\begin{tikzpicture}
\clip (0, 0) circle (2cm) [blur shadow={shadow xshift=10pt, shadow yshift=-5pt, shadow blur[![This is expected image.][1]][1] radius = 1pt, shadow opacity=15}]node(Vishakha){\includegraphics[width=4cm]{rose.jpg}};
\end{tikzpicture}
\end{minipage}
\end{tcolorbox}
\end{document}

I get:

Image 2

But I want to obtain a result similar to the following:

Image 1

J Leon V.
  • 11,533
  • 16
  • 47
Vishakha
  • 119
  • 1
    Can I ask what you mean by appropriate shadow effect? – Paul A Feb 25 '24 at 17:40
  • does this help -- https://tex.stackexchange.com/questions/710310/how-to-give-the-shadow-effect-which-is-shown-in-the-below-image-for-the-white-re?rq=1 -- from the related questions – js bibra Feb 26 '24 at 05:41
  • I want to add south east shadow effect to the above image. Since I have used \clip to fit the image in a circle so I got confused how to give the shadow effect to the image. – Vishakha Feb 29 '24 at 18:48
  • /$LaTeX/$ ........ – ADITYA DAS Mar 02 '24 at 11:36
  • Please stop removing the code indentation and don't place the image in the middle of your code. The previous revision fixed all these problems for you, but now you added them again to your post https://tex.stackexchange.com/posts/711476/revisions – samcarter_is_at_topanswers.xyz Mar 02 '24 at 13:15
  • I'm extremely sorry for the inconvenience I wasn't aware of this. I just wanted to add the images as a reference but accidentally code has placed my images in between. Later I did try to correct it but I couldn't. Please do let me know how to correct it so that I won't make this mistake again. – Vishakha Mar 04 '24 at 08:30

1 Answers1

1

Here are some options using iterations and mixing colors through opacity.

RESULT:

enter image description here

MWE:

\documentclass[12pt]{article} 
\usepackage{tikz}
\usepackage{duckuments}% Added for MWE implementation
\usepackage{tikzpagenodes} 
\usetikzlibrary{arrows, shapes, positioning, shadows.blur,decorations.pathmorphing} 
\usepackage[most]{tcolorbox} 
\usepackage[left=0.1cm, right=0.1cm, top=0.1cm, bottom=0.1cm]{geometry}

\definecolor{titleBack}{HTML}{203864}

\begin{document}

\tcbset{colback=titleBack} 

\begin{tcolorbox} 
    \begin{minipage}{0.25\linewidth} 
        \begin{tikzpicture}
            \foreach \x in {1,2,...,60}{
                \fill[white, fill opacity=0.03](\x*0.015cm*rand,-\x*0.015cm*rand) circle (2cm);
            }
            \clip (0, 0) circle (2cm) node(Vishakha){\includegraphics[width=8cm]{example-image-duck}}; 
        \end{tikzpicture} 
    \end{minipage}
    \begin{minipage}{0.25\linewidth} 
        \begin{tikzpicture}
            \foreach \x in {1,2,...,50}{
                \pgfmathparse{0.9*rnd+0.3}
                \definecolor{Rcolor}{rgb}{\pgfmathresult,\pgfmathresult,\pgfmathresult}
                \fill[titleBack!50!Rcolor, fill opacity=0.05](0+\x*0.01cm*rand*rand,0-\x*0.01cm*rand*rand) circle (2cm+\x*0.005cm);
            }
            \clip (0, 0) circle (2cm) node(Vishakha){\includegraphics[width=8cm]{example-image-duck}}; 
        \end{tikzpicture} 
    \end{minipage}
    \begin{minipage}{0.25\linewidth} 
        \begin{tikzpicture}
            \draw[blur shadow={
                shadow blur steps=15,
                shadow blur extra rounding=5pt, 
                shadow xshift=5pt}] (0, 0) circle (2cm);
            \clip (0, 0) circle (2cm) node(Vishakha){\includegraphics[width=8cm]{example-image-duck}}; 
        \end{tikzpicture} 
    \end{minipage}

\end{tcolorbox} 

\begin{tcolorbox} 
    \begin{minipage}{0.25\linewidth} 
        \begin{tikzpicture}
            \foreach \x in {1,2,...,60}{
                \fill[black!\x!white, fill opacity=0.02](\x*0.007cm,-\x*0.007cm) circle (2.1cm-\x*0.0005cm);
            }
            \clip (0, 0) circle (2cm) node(Vishakha){\includegraphics[width=8cm]{example-image-duck}}; 
        \end{tikzpicture} 
    \end{minipage}
    \begin{minipage}{0.25\linewidth} 
        \begin{tikzpicture}[pencildraw/.style={
                decorate,
                decoration={random steps,segment length=4pt,amplitude=2pt}
            }
        ]
            \foreach \x in {1,2,...,20}{
                \fill[white, fill opacity=0.02,pencildraw](0+\x*0.01cm*rand,0-\x*0.0cm*rand) circle (2cm+\x*0.02cm);
            }
            \clip (0, 0) circle (2cm) node(Vishakha){\includegraphics[width=8cm]{example-image-duck}}; 
        \end{tikzpicture} 
    \end{minipage}
    \begin{minipage}{0.25\linewidth} 
        \begin{tikzpicture}
            \foreach \x in {0,1,2,...,20}{
                \fill[white, fill opacity=0.2](\x*10:\x*0.1cm) circle (2.25cm-\x*0.1cm);
            }
            \clip (0, 0) circle (2cm) node(Vishakha){\includegraphics[width=8cm]{example-image-duck}}; 
        \end{tikzpicture} 
    \end{minipage}

\end{tcolorbox} 

\end{document}

J Leon V.
  • 11,533
  • 16
  • 47
  • Thanks a lot! It helped me a lot to understand about shadow. Can please tell me what is \x0.015cmrand? – Vishakha Mar 08 '24 at 12:48
  • @Vishakha Since I use the iterative variable within the for structure, I use rand, which for each iteration returns a quasi-random number between -1 and 1. I multiply this by a dimensional amplitude to obtain random positions in each iteration of the for loop. – J Leon V. Mar 08 '24 at 15:37
  • Thanks for clarification! – Vishakha Mar 08 '24 at 17:24