def within_bounds(pixel_x, pixel_y, bounds):
    """Check whether x and y pixel coordinates are within bounds"""
    return (pixel_y < bounds[0]) and (pixel_x < bounds[1]) and (pixel_y > 0) and (pixel_x > 0)