FFitLumen
Product

Product features · Aspect-fit pixel boxes

01

Put source and container dimensions in a small fixture table and inspect the integer result before connecting it to an image-placement style.

01

Connection

Base URL, credentials and a reachable server.

02

Selection

A model available through the configured endpoint.

03

Capabilities

Context limits and tool support are determined by the model and server.

Aspect-fit pixel boxes

● ● ●FitLumen●
A concrete starting point · Aspect-fit pixel boxes ×
def fit_box(image_width, image_height, box_width, box_height):
    values = (image_width,image_height,box_width,box_height)
    if any(type(v) is not int or not 1 <= v <= 1000000 for v in values):
        raise ValueError("dimensions 1 through 1000000")
    if image_width*box_height > image_height*box_width:
        width, height = box_width, image_height*box_width//image_width
    else:
        width, height = image_width*box_height//image_height, box_height
    if not width or not height: raise ValueError("subpixel result")
    return (box_width-width)//2, (box_height-height)//2, width, height
✳Fit an image into a pixel box using integer dimensions from 1 through 1000000.
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗