Browse documentation
aner.image · Reference

Image API reference

Inspect exact native image signatures, defaults, typed views, analysis contracts and integration boundaries.

ImplementedAner 0.1.0 or newer

Generated from the same declarations as native bindings and editor help. See Aner Image for resource, precision, ownership, coordinate, codec and execution contracts.

All indices are zero based. Images, views, masks, labels, regions and plans are immutable. Contexts share a live byte ledger and persistent executor. Scalar sample access is for inspection; bulk operations execute native kernels. Tensor exports are owned detached CPU copies with explicit dtype/layout; no hidden device readback. Named defaults do not change source evaluation order.

Native callResultContract
image.context(memory_mb:Int64=512, workers:Int64=0, tile_rows:Int64=32, max_components:Int64=1000000)ImageContextCreate one persistent native executor and shared image buffer byte ledger. Zero workers uses CPU admission policy; reuse this context.
image.context_with(execution:ParallelContext, memory_mb:Int64=512, tile_rows:Int64=32, max_components:Int64=1000000)ImageContextBorrow an existing local CPU executor. Nested/concurrent use follows aner.parallel admission rules.
image.create(context:ImageContext, width:Int64, height:Int64, channels:Int64=1, dtype:String="UInt8", value:Float64=0.0)ImageCreate a typed constant image. Integer values must be exactly representable.
image.load(context:ImageContext, path:String, page:Int64=0)ImageDecode a local image under the context budget; preserve sample dtype and range. Optional codecs are explicit capabilities.
image.load_region(context:ImageContext, path:String, x:Int64, y:Int64, width:Int64, height:Int64, page:Int64=0)ImageRead a pixel region. Decoder specific source/workspace limits still apply; this is not a universal out of core guarantee.
image.inspect(context:ImageContext, path:String, page:Int64=0)ImageInfoRead a typed header without decoding pixel storage.
image.save(value:Image, path:String, format:String="auto", quality:Int64=95)UnitWrite a new image file; existing files are preserved. JPEG encoding is explicitly lossy; unsupported dtype/format pairs fail.
image.available(format:String)BoolReport a compiled native format capability; does not open files.
image.capabilities()StringReport native format capabilities; configuration and execution never download codecs.
image.pipeline(context:ImageContext)ImagePlanCreate an immutable reusable analysis plan using the supplied context.
image.channel(value:Image, index:Int64)ImageSelect one channel; Image selection is a strided immutable view.
image.gaussian(value:Image, sigma:Float64=1.0, border:String="reflect", invalid:String="reject")ImageSeparable native Gaussian filter with explicit border and invalid sample policy.
image.threshold(value:Image, cutoff:Float64, above:Bool=true, invalid:String="reject")ImageMaskCreate a strict threshold mask; ignored invalid samples are excluded.
image.otsu(value:Image, bins:Int64=256, invalid:String="reject")ImageMaskOtsu mask from the finite source range. Constant images produce empty strict above foreground.
image.channel(value:ImagePlan, index:Int64)ImagePlanSelect one channel; Image selection is a strided immutable view.
image.gaussian(value:ImagePlan, sigma:Float64=1.0, border:String="reflect", invalid:String="reject")ImagePlanSeparable native Gaussian filter with explicit border and invalid sample policy.
image.threshold(value:ImagePlan, cutoff:Float64, above:Bool=true, invalid:String="reject")ImagePlanCreate a strict threshold mask; ignored invalid samples are excluded.
image.otsu(value:ImagePlan, bins:Int64=256, invalid:String="reject")ImagePlanOtsu mask from the finite source range. Constant images produce empty strict above foreground.
image.components(value:ImageMask, connectivity:Int64=8)ImageLabelsExact UInt32 connected component labels, background zero; stable first pixel ordering with four or eight connectivity.
image.components(value:ImagePlan, connectivity:Int64=8)ImagePlanExact UInt32 connected component labels, background zero; stable first pixel ordering with four or eight connectivity.
image.run(value:ImagePlan, source:Image)ImageResultExecute the plan in order; source input and previous results remain immutable.
image.run(value:ImagePlan, source:String)ImageResultExecute the plan in order; source input and previous results remain immutable.
image.copy(value:Image)ImageMake an explicit owned copy under the image context budget.
image.crop(value:Image, x:Int64, y:Int64, width:Int64, height:Int64)ImageRead only ROI view; retains the parent allocation and updates physical origin.
image.cast(value:Image, dtype:String, conversion:String="exact")ImageExplicit sample conversion. Exact conversion rejects precision loss; clipping requires an explicit policy.
image.scale(value:Image, factor:Float64, offset:Float64=0.0, dtype:String="Float32")ImageApply value*factor+offset into the explicit destination dtype.
image.resize(value:Image, width:Int64, height:Int64, filter:String="nearest", invalid:String="reject")ImageResize with explicit nearest/bilinear sampling and calibrated geometry.
image.flip(value:Image, axis:String="horizontal")ImageFlip pixels and physical coordinate mapping.
image.rotate(value:Image, turns:Int64=1)ImageRotate by integer quarter turns without interpolation.
image.grayscale(value:Image, method:String="mean")ImageExplicit channel reduction; no hidden gamma or ICC transformation.
image.rgb(value:Image)ImageExplicit replication of one numeric channel into three RGB channels; alpha is not silently discarded.
image.calibrate(value:Image, spacing_x:Float64, spacing_y:Float64, units:String="pixel")ImageMetadata only view with positive pixel spacing. Unit labels are descriptive and are not automatically converted.
image.physical_x(value:Image, x:Float64, y:Float64)Float64Map a pixel center coordinate into calibrated physical coordinates.
image.physical_y(value:Image, x:Float64, y:Float64)Float64Map a pixel center coordinate into calibrated physical coordinates.
image.dilate(value:ImageMask, radius:Int64=1)ImageMaskNative binary morphology with declared zero background borders.
image.erode(value:ImageMask, radius:Int64=1)ImageMaskNative binary morphology with declared zero background borders.
image.open(value:ImageMask, radius:Int64=1)ImageMaskNative binary morphology with declared zero background borders.
image.close(value:ImageMask, radius:Int64=1)ImageMaskNative binary morphology with declared zero background borders.
image.stats(value:Image, channel:Int64=0, invalid:String="reject")ImageStatisticsDeterministic statistics. Empty valid support has count zero and undefined moments; inspect count before moment access.
image.masked_stats(value:Image, mask:ImageMask, channel:Int64=0, invalid:String="reject")ImageStatisticsStatistics on selected pixels with exact validity counts.
image.histogram(value:Image, bins:Int64=256, minimum:Float64=0.0, maximum:Float64=255.0, channel:Int64=0, invalid:String="reject")ImageHistogramExact integer bin counts in an explicit inclusive range; out of range finite samples fail.
image.cutoff(value:ImageHistogram)Float64Return the deterministic Otsu threshold for this histogram.
image.bin(value:ImageHistogram, index:Int64)Int64Read an exact bin count.
image.regions(value:ImageLabels, source:Image, channel:Int64=0, invalid:String="reject")ImageRegionsMeasure components against the explicit original intensity image. Shape/geometry must match.
image.regions(value:ImageResult, source:Image, channel:Int64=0, invalid:String="reject")ImageRegionsMeasure components against the explicit original intensity image. Shape/geometry must match.
image.label(value:ImageRegions, index:Int64)Int64Read one checked native region measurement; region indices are zero based.
image.area(value:ImageRegions, index:Int64)Int64Read one checked native region measurement; region indices are zero based.
image.x(value:ImageRegions, index:Int64)Int64Read one checked native region measurement; region indices are zero based.
image.y(value:ImageRegions, index:Int64)Int64Read one checked native region measurement; region indices are zero based.
image.region_width(value:ImageRegions, index:Int64)Int64Read one checked native region measurement; region indices are zero based.
image.region_height(value:ImageRegions, index:Int64)Int64Read one checked native region measurement; region indices are zero based.
image.valid_count(value:ImageRegions, index:Int64)Int64Read one checked native region measurement; region indices are zero based.
image.invalid_count(value:ImageRegions, index:Int64)Int64Read one checked native region measurement; region indices are zero based.
image.centroid_x(value:ImageRegions, index:Int64)Float64Read one checked native region measurement; region indices are zero based.
image.centroid_y(value:ImageRegions, index:Int64)Float64Read one checked native region measurement; region indices are zero based.
image.physical_area(value:ImageRegions, index:Int64)Float64Read one checked native region measurement; region indices are zero based.
image.intensity_mean(value:ImageRegions, index:Int64)Float64Read one checked native region measurement; region indices are zero based.
image.intensity_minimum(value:ImageRegions, index:Int64)Float64Read one checked native region measurement; region indices are zero based.
image.intensity_maximum(value:ImageRegions, index:Int64)Float64Read one checked native region measurement; region indices are zero based.
image.intensity_sum(value:ImageRegions, index:Int64)Float64Read one checked native region measurement; region indices are zero based.
image.width(value:Image)Int64Read image dimensions without copying pixels.
image.height(value:Image)Int64Read image dimensions without copying pixels.
image.width(value:ImageMask)Int64Read image dimensions without copying pixels.
image.height(value:ImageMask)Int64Read image dimensions without copying pixels.
image.width(value:ImageLabels)Int64Read image dimensions without copying pixels.
image.height(value:ImageLabels)Int64Read image dimensions without copying pixels.
image.width(value:ImageInfo)Int64Read image dimensions without copying pixels.
image.height(value:ImageInfo)Int64Read image dimensions without copying pixels.
image.dtype(value:Image)StringRead the exact stored sample dtype or channel count.
image.channels(value:Image)Int64Read the exact stored sample dtype or channel count.
image.dtype(value:ImageInfo)StringRead the exact stored sample dtype or channel count.
image.channels(value:ImageInfo)Int64Read the exact stored sample dtype or channel count.
image.pages(value:ImageInfo)Int64Read retained file/page header metadata.
image.page(value:ImageInfo)Int64Read retained file/page header metadata.
image.orientation(value:ImageInfo)Int64Read retained file/page header metadata.
image.format(value:ImageInfo)StringRead the detected format, independent of filename extension.
image.spacing_x(value:Image)Float64Read calibrated sample spacing.
image.spacing_y(value:Image)Float64Read calibrated sample spacing.
image.units(value:Image)StringRead the descriptive physical unit label.
image.metadata(value:Image)StringReturn bounded geometry/source metadata as JSON; contains no pixel payload.
image.contiguous(value:Image)BoolReport whether the image view is contiguous.
image.retained_bytes(value:Image)Int64Read the full retained parent allocation, including pixels outside a crop.
image.sample(value:Image, x:Int64, y:Int64, channel:Int64=0)Float64Read one checked scalar sample; bulk kernels avoid per pixel language overhead.
image.sample(value:ImageMask, x:Int64, y:Int64, channel:Int64=0)BoolRead one checked scalar sample; bulk kernels avoid per pixel language overhead.
image.sample(value:ImageLabels, x:Int64, y:Int64, channel:Int64=0)Int64Read one checked scalar sample; bulk kernels avoid per pixel language overhead.
image.image(value:ImageMask)ImageReturn the immutable numeric image associated with this result.
image.image(value:ImageResult)ImageReturn the immutable numeric image associated with this result.
image.mask(value:ImageResult)ImageMaskReturn the immutable typed pipeline result.
image.labels(value:ImageResult)ImageLabelsReturn the immutable typed pipeline result.
image.count(value:ImageLabels)Int64Read component/region/valid-sample count.
image.count(value:ImageRegions)Int64Read component/region/valid-sample count.
image.count(value:ImageStatistics)Int64Read component/region/valid-sample count.
image.count(value:ImageHistogram)Int64Read component/region/valid-sample count.
image.invalid(value:ImageStatistics)Int64Read invalid selected sample count.
image.minimum(value:ImageStatistics)Float64Read a finite bound; undefined statistics fail explicitly.
image.maximum(value:ImageStatistics)Float64Read a finite bound; undefined statistics fail explicitly.
image.invalid(value:ImageHistogram)Int64Read invalid selected sample count.
image.minimum(value:ImageHistogram)Float64Read a finite bound; undefined statistics fail explicitly.
image.maximum(value:ImageHistogram)Float64Read a finite bound; undefined statistics fail explicitly.
image.sum(value:ImageStatistics)Float64Read a checked statistic. Variance uses the documented population denominator.
image.mean(value:ImageStatistics)Float64Read a checked statistic. Variance uses the documented population denominator.
image.variance(value:ImageStatistics)Float64Read a checked statistic. Variance uses the documented population denominator.
image.stddev(value:ImageStatistics)Float64Read a checked statistic. Variance uses the documented population denominator.
image.used_bytes(value:ImageContext)Int64Read context owned allocation accounting; Tensor exports and external provider allocations have separate accounting.
image.peak_bytes(value:ImageContext)Int64Read context owned allocation accounting; Tensor exports and external provider allocations have separate accounting.
image.remaining_bytes(value:ImageContext)Int64Read context owned allocation accounting; Tensor exports and external provider allocations have separate accounting.
image.workers(value:ImageContext)Int64Read configured native compute worker count; this is not a claim about all provider/OS threads.
image.summary(value:Image)StringReturn a bounded native summary.
image.summary(value:ImageMask)StringReturn a bounded native summary.
image.summary(value:ImageLabels)StringReturn a bounded native summary.
image.summary(value:ImageRegions)StringReturn a bounded native summary.
image.from_tensor(context:ImageContext, samples:Tensor, dtype:String="native", layout:String="HW", scale:Float64=1.0, offset:Float64=0.0)ImageOwned CPU copy; native preserves Tensor dtype. Integer conversions must be exact. No hidden device readback.
image.tensor(value:Image, dtype:String="Float32", layout:String="NCHW", scale:Float64=1.0, offset:Float64=0.0)TensorExplicit detached owned CPU Tensor; supports HW/HWC/CHW/NCHW/FLAT. Scaling is explicit; invalid samples fail.
image.features(value:Image, dtype:String="Float64")TensorOwned rank two features: Image uses one HWC order row; Regions uses area,physical_area,centroid_x,centroid_y,width,height,mean,minimum,maximum. Empty/undefined regions fail.
image.features(value:ImageRegions, dtype:String="Float64")TensorOwned rank two features: Image uses one HWC order row; Regions uses area,physical_area,centroid_x,centroid_y,width,height,mean,minimum,maximum. Empty/undefined regions fail.
image.values(value:ImageLabels)TensorOwned HW Tensor; exact UInt32 labels use Float64, binary mask values use Float32.
image.values(value:ImageMask)TensorOwned HW Tensor; exact UInt32 labels use Float64, binary mask values use Float32.
image.from_frame(context:ImageContext, frame:VideoFrame)ImageExplicit immutable RGB8 frame copy retaining source/session/sequence/timestamps.
image.from_frame(context:ImageContext, frame:VideoFrameSlot)ImageExplicit immutable RGB8 frame copy retaining source/session/sequence/timestamps.
image.plot(value:Image, minimum:Float64=0.0, maximum:Float64=255.0, max_pixels:Int64=65536)ChartBounded native PNG raster preview. Display mapping never changes analysis values.
image.mask_plot(value:Image, mask:ImageMask, minimum:Float64=0.0, maximum:Float64=255.0, max_pixels:Int64=65536)ChartBounded raster preview with coordinate aligned typed overlay.
image.label_plot(value:Image, labels:ImageLabels, minimum:Float64=0.0, maximum:Float64=255.0, max_pixels:Int64=65536)ChartBounded raster preview with coordinate aligned typed overlay.
vision.prepare_into(plan:VisionPlan, frame:Image, input:VisionInput)UnitPrepare a typed three channel Image directly; use explicit RGB conversion and model normalization.
Aner documentation · Reference and guides