PL/IMAGE — Image Manipulation for Oracle Applications
Load, transform, composite and save images directly from PL/SQL using Oracle BLOBs. PL/IMAGE provides a complete imaging pipeline with precise resizing, geometric edits, alpha blending, overlays and stitching without leaving your database environment.
Process images where your Oracle data already lives
PL/IMAGE is designed for Oracle applications that manage user uploads, product photos, or document scans stored as BLOBs. It operates entirely within the database without requiring external file system directories or OS utilities.
Independent BLOB LOBs
Input source BLOBs are borrowed and never modified. Returned image BLOBs are independent temporary LOBs owned by the caller.
Complete editing suite
Crop, resize, thumbnail, rotate, flip, pad, border, normalize orientation, adjust grayscale, invert, threshold, flatten, overlay, and stitch images.
PNG and JPEG codecs
Load PNG or baseline JPEG sources and save edited pixels back to PNG or JPEG with fine-grained control over compression and quality.
Choose the image API that matches your workflow
Manage session-local image contexts through simple lifecycle functions and powerful mutation procedures.
Load and Save
Decode source blobs into independent references, apply transformations in order, and encode to output.
l_image := pl_image.load_image(l_blob);
l_result := pl_image.save_image(
p_image => l_image,
p_format => 'JPEG',
p_jpeg_quality => 85
);
Geometric Edits
Normalize EXIF orientations, resize with advanced filters, or crop and thumbnail with exact alignment options.
pl_image.normalize_orientation(l_image);
pl_image.resize(
p_image => l_image,
p_width => 800,
p_filter => 'AUTO'
);
Compositing
vOverlay watermarks with source-over opacity or stitch multiple image collections horizontally or vertically.
pl_image.overlay(
p_image => l_image,
p_overlay => l_watermark,
p_x => 10,
p_y => 10,
p_opacity => 0.8
);
Built for precise pixel and color fidelity
Image interpolation and compositing use premultiplied-alpha arithmetic on encoded sRGB values, converted back to straight alpha for robust storage and output.
Sizing and filter modes
Choose from AUTO, NEAREST, BILINEAR, or AREA filters. AUTO uses area averaging on shrinking axes and linear interpolation on enlarging axes.
Thumbnail fitting options
CONTAIN maintains proportion inside target bounds without padding, while COVER fills and crops to exact dimensions with customizable alignments.
EXIF orientation management
Inspect orientation tags (1 through 8) via info records and consume them explicitly with normalize_orientation before geometric edits.
A predictable codec and color policy
Output formats are handled cleanly with dedicated options for PNG compression levels, filters, and JPEG quality metrics.
PNG Output Defaults
- Non-interlaced 8-bit Gray, RGB, Gray-alpha, and RGBA
- Compression levels 1 through 9
- Filter choices: NONE or ADAPTIVE
- Preserves full alpha transparency channel
JPEG and Flattening
Baseline JPEG output supports 8-bit grayscale or YCbCr. Because JPEG does not support transparency, any non-opaque image pixels require an explicit flatten operation with a chosen background color before saving.
Designed for robust transaction safety
Automatic Context Cleanup
Failed loads and processing exceptions automatically release internal working data and close session contexts without leaking memory.
No Transaction Side-Effects
The package does not commit or roll back the caller’s transaction, and avoids any dependency on Oracle DIRECTORY objects.
Normalized Colors
Colors are specified using normalized records (0 to 1 range for red, green, blue, and alpha) with convenient constructors like rgba().
Process images before embedding them into PDF reports.
Combine PL/IMAGE with PL/PDF to dynamically resize, watermark, or crop photos and charts inside Oracle before generating final customer documentation.
Comprehensive API Scope
A full overview of the core functions and procedures available in the PL/IMAGE package specification.
Lifecycle & Geometry
load_imageandsave_imagecrop(exact pixel coordinates)resize(with multiple sampling filters)thumbnail(CONTAIN and COVER modes)rotateandflip(axes)padandborderadditionsnormalize_orientation(EXIF 1–8)
Color, Overlay & Stitching
grayscale,invert, andthresholdflatten(background color removal)overlay(source-over with opacity)stitch(horizontal or vertical layouts)get_info(format, dimensions, depth)rgbacolor constructor utility
Image processing for real Oracle workflows
Empower your database applications to handle images seamlessly before storage, distribution, or report rendering.
User Avatars & Scans
Standardize uploaded profile pictures, ID scans, and document attachments to uniform dimensions upon ingestion.
Watermarking
Apply transparent branding overlays or confidentiality notices directly onto images before publishing.
Collages & Stitching
Combine multiple photographic evidence items or product shots into clean composite images.
Try PL/IMAGE
Request access to a hosted sandbox, or evaluate PL/IMAGE in your own Oracle environment with an install kit and evaluation key.
