MV Check if image is currently being displayed

So I need to check if an image is currently being displayed in the game via JS.
I tried
$gameScreen.picture(1) == true
but it always returns false, even though the image is being displayed. If I type $gameScreen.picture(1) into the console, it even shows all the relevant data.

How do I solve this?
If I type $gameScreen.picture(1) into the console, it even shows all the relevant data.
that is the reason - "all the relevant data" means there is more data than just a boolean true or false.
an equal comparison can only give true if there is the same data on both sides.

However your entire concept behind the question is strange.
you are the one who makes and erase the pictures, so you should be able to tell if a picture is gone or not.
and if you need it dynamically, then I suggest adding a switch that you turn on or of when you create the picture or erase it.
So I need to check if an image is currently being displayed in the game via JS.
I tried
$gameScreen.picture(1) == true
but it always returns false, even though the image is being displayed. If I type $gameScreen.picture(1) into the console, it even shows all the relevant data.

How do I solve this?
Check if the picture has been displayed and not deleted:
$gameScreen._pictures[13] != null

Check if the picture is displayed and has opacity:
$gameScreen._pictures[13] != null && $gameScreen._pictures[13]._opacity > 0
Check if the picture has been displayed and not deleted:
$gameScreen._pictures[13] != null
This did the trick, thank you very much

Original thread: https://forums.rpgmakerweb.com/threads/check-if-image-is-currently-being-displayed.148462/