I am trying to solve something that looked pretty straightforward at the beginning, but has developed into a little nightmare. I was able to code parts of the functionality described below, but not all together.
I have images as DataURLs on a website. Dimensions and aspect ratios of these images are variable. I want to create some kind of lightbox with the following characteristics (see scheme):
IMG(orDIV) with preserved aspect ratio (likeobject-fit: contain;orbackground-image: contain;)- responsive
- nearly full screen with ~1em margin
- horizontally and vertically centered
- a
DIVexactly overlying thatIMG(orDIV) as container for blending a result image - another exactly overlying
DIVas container for corner texts - as background canvas a full view port
DIV(position: fixed; inset: 0;behaviour) with elevated brightness and backdrop-filter

I tried all of the related methods suggested here, but was not able to get the whole functionality. Is there any way to do this with HTML/CSS? Is there a (simple) way to achieve this in Javascript?