Ionic 4, Background image opacity

I’m working on an app in which i’m getting images from API. Using that api i’m changing my apps background image:

<ion-content [ngStyle]="{'background-image': 'url(' + img1+ '),url(' + img2+ ')'}"
[style.background-size]="'100% 50%, 100% 50%'" [style.background-repeat]="'no-repeat, repeat'">

As images are too bright so i want to set the background image opacity, as i change opacity in content it sets the opacity of whole page. Is there a way to set the opacity of only image?

Thank you.

1 Like