You can do a lot of things with KOMA-Script's chapter headings, if you redefine \chapterformat and \chapterlinesformat or \chapterlineswithprefixformat. If I interpret your question as
How to use ducks in chapter headings of KOMA-Script?
I could, e.g, do:
\documentclass[chapterprefix]{scrbook}
\usepackage{lmodern}% need scalable font
\usepackage{tikzducks}% essential to use ducks
\usepackage{blindtext}
\RedeclareSectionCommand[%
font=\normalfont\huge\scshape,
prefixfont=\Large,
innerskip=0pt
]{chapter}
\let\raggedchapter\raggedleft
\renewcommand*{\chapterlineswithprefixformat}[3]{%
\IfArgIsEmpty{#2}{#3}{%
\rule{.333\linewidth}{1pt} #2%
\parbox[b][\dimexpr .2\linewidth-\dp\strutbox-\baselineskip]{.78\linewidth}{%
\raggedchapter\strut\ignorespaces #3%
}\hfill
\makebox[.2\linewidth][r]{\rule[-\dp\strutbox]{\linewidth}{1pt}}%
}%
}
\renewcommand*{\chapterformat}{%
\IfUsePrefixLine{%
\chapapp\enskip
\usekomafont{chapter}%
\raisebox{\dimexpr -.2\linewidth+\baselineskip}[0pt][0pt]{%
% \frame{%
\resizebox*{.2\linewidth}{.2\linewidth}{%
\currentchapternumberbackground
}%
% }%
\makebox[0pt][r]{%
\parbox{.2\linewidth}{%
\centering
\fontsize{.75\linewidth}{\linewidth}\selectfont
\raisebox{.75\linewidth}{\color{gray!50!red!50}\thechapter}\par
}%
}%
}%
}{%
\thechapter\autodot\enskip
}%
}
\newcommand*{\chapternumberbackground}[1]{%
\renewcommand*{\currentchapternumberbackground}{#1}%
}
\newcommand*{\currentchapternumberbackground}{%
{\color{red!50}\rule{1cm}{1cm}}%
}
\begin{document}
\tableofcontents
\chapternumberbackground{\begin{tikzpicture}\duck\end{tikzpicture}}
\chapter{Chapter Name}
\blindtext
\chapternumberbackground{\begin{tikzpicture}\duck[longhair=teal]\end{tikzpicture}}
\chapter{Another Chapter Name}
\blindtext
\chapternumberbackground{\begin{tikzpicture}\duck[crazyhair=green,eyebrow=blue]\end{tikzpicture}}
\chapter{Once more a Longer Chapter Name}
\blindtext
\end{document}



For more information about \RedeclareSectionCommand, \chapterformat and \chapterlineswithprefixformat see the KOMA-Script manual also available in German. And don't forget the famous information about using ducks in TikZ.
And yes, instead of the tikzpicture with the \duck commands, you can use a \includegraphics command like:
\chapternumberbackground{\includegraphics[page=54,trim=30 0 30 0,clip]{example-image-duck}}
Note, the \resizebox in the code of the full example would resize such an external image too. So if you want images in another size, you have to change or remove the \resizebox.
\includegraphicsto my answer. – Schweinebacke Apr 02 '19 at 07:32