Skip to main content

picvane_image_geometry 0.1.0 copy "picvane_image_geometry: ^0.1.0" to clipboard
picvane_image_geometry: ^0.1.0 copied to clipboard

Integer helpers to plan image aspect ratios, fit sizes, and centered crops for Dart and Flutter applications.

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.

0
likes
150
points
--
downloads

Documentation

API reference

Publisher

unverified uploader

Integer helpers to plan image aspect ratios, fit sizes, and centered crops for Dart and Flutter applications.

Homepage

License

MIT (license)

More

Packages that depend on picvane_image_geometry