Run imagej macro on numpy array


I built my image processing pipeline in python but am looking for some Imagej functionality such as the rolling ball background subtraction. I have the following problem:

import numpy as np
import matplotlib.pyplot as plt
from skimage import io
from jnius import autoclass

import imagej
ij = imagej.init('sc.fiji:fiji:2.0.0-pre-10')

After initializing imagej and everything else, I import an image as numpy array (I would use a pre-processed image / numpy array in my actual workflow but it’s easier to use a web image here).

After converting the image to java, I try to run a macro on said image. However, I don’t seem to be able to open / tell imagej which image I want open.

url = ''
img = io.imread(url)
img = np.array(img)
img_java =

macro = f'''
run("Subtract Background...", "rolling=50 light sliding");

WindowManager = autoclass('ij.WindowManager')
# Open my image / in macro?
curr_image = WindowManager.getCurrentImage()
output =

Does anybody know how I can specify open my image or if there is a workaround.
Thanks in advance for any suggestions. BBQuercus