Calculation of the area with differently illuminated background

I am a new Image J user and hope you can help me.
I am photographing murine lungs under a binocular in a yellowish solution. I would like to calculate two things: 1. the total area of the lung and 2. the individual blue stained areas. I now have the problem that I have a lot of images and would like to use an automated process. I have written a macro that calculates the areas. Unfortunately this only works if the background is uniformly illuminated (i.e. white or black). I used Photshop to automatically remove the background, which worked very well. Now I have the problem that we don’t have Photoshop anymore and I want to have the same result with Image J. So my question is, is there a way to remove the background in Image J ? If yes, is it possible to automate this process ? Or if there is no way to remove the background completely, is there a way to compensate for the different lighting ?
I have 2 example images. Image1: unprocessed image Image2: processed, without background ( Photoshop used).
I haven’t found a question on this forum yet that answers my problem, but if I do please excuse me.

I would be very grateful for your help

Thanks a lot! MK pic 1|666x500 pic 2.tif (16.5 MB)