PicVane Image Geometry
Dart helpers for calculating image aspect ratios, fitting images in a box, and planning centered cover crops. PicVane is a browser-based AI image and video studio. This package is an independent geometry helper: it does not process or upload images, generate media, or call the PicVane service.
Usage
import 'package:picvane_image_geometry/picvane_image_geometry.dart';
final source = (width: 1920, height: 1080);
final target = (width: 1080, height: 1080);
final ratio = aspectRatio(source); // 16 by 9
final fit = fitSize(source, target); // 1080 by 607
final cover = coverPlan(source, target); // 1920 by 1080; crop at 420, 0
Inputs must be positive integer dimensions no larger than 67,108,863 pixels per side. Fit rounds down and clamps to at least one pixel; cover rounds up. Both can enlarge the input. Crop offsets are measured from the resized image's top left. Rotation metadata and encoder-specific constraints are not considered.
Requires Dart 3.0 or later. Installation and functionality have not yet been independently tested.
Libraries
- picvane_image_geometry
- Integer geometry for image sizing and centered crops.