bpy - how to select an image running blender in -background mode so an operator can use it?
(Edit) Deleted 1. Solution
2. Solution
This code inverts, the color of a picture. Maybe a bit slower than the Operator but not by much.
It's use bpy.data so you have to input the name of the picture to get it.
import bpy

def invert(image, invert_r = True, invert_g = True, invert_b = True, invert_a = True):
    pixels = list(image.pixels)
    if invert_r: 
        for i in range(0, len(pixels), 4): # R
            pixels[i] = 1 - pixels[i]
    if invert_g:
        for i in range(1, len(pixels), 4): # G
            pixels[i] = 1 - pixels[i]
    if invert_b:
        for i in range(2, len(pixels), 4): # B
            pixels[i] = 1 - pixels[i]
    if invert_a:
        for i in range(3, len(pixels), 4): # A
            pixels[i] = 1 - pixels[i]
    image.pixels = pixels
            
#Example           
image = bpy.data.images['Untitled']     
invert(image, invert_a = False)

You could also use this code to input a sequence of images
(exchange this with the code after #Example).
images = ['Untitled', 'Untitled.001']
for image in images:
    invert(image, invert_a = False)