Extract any >=2bpp image we think we can improve

def extract_images_generic(pike, root, log, options):
    """Extract any >=2bpp image we think we can improve"""

    jpegs = []
    pngs = []
    for _, xref, ext in extract_images(pike, root, log, options, extract_image_generic):
        log.debug('xref = %s ext = %s', xref, ext)
        if ext == '.png':
            pngs.append(xref)
        elif ext == '.jpg':
            jpegs.append(xref)
    log.debug("Optimizable images: JPEGs: %s PNGs: %s", len(jpegs), len(pngs))
    return jpegs, pngs