Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module provides an image effect that scales an image to fit within specified dimensions, filling any remaining space with a background. You can choose from background styles like tiling, blurring, a dominant color, or a gradient. This is useful for displaying images with different aspect ratios without cropping.

Image Scale and Fill Background is a Drupal image effect that scales images to fit within defined dimensions while seamlessly filling the remaining space with a background style.

Features

Choose between a tiled background, a blurred image background, a dominant color fill, or a gradient effect, each offering unique visual appeal. Ideal for maintaining consistent image display ratios without sacrificing visual integrity, this module is perfect for designs where you have to display images in different aspect ratios without cropping.

This module currently only support PHP GD that comes with Drupal.

Scale to Fit: Dynamically scales original images to fit within a specified width and height.
Background Fill: Fills excess space with a choice of:

  • A tiled version of the image.
  • A blurred version of the image.
  • The dominant color extracted from the image.
  • A gradient based on the dominant color.

Customizable Options: Configurable options for blur intensity, gradient direction, and resize ratio.

Post-Installation

The image effect can be configured with the following options:

  • Width and Height: Define the dimensions of the target area the image should scale to fit.
  • Background Type: Choose between a tiled background, blurred background, dominant color, or gradient fill.
  • Background Style: Choose how the background will be styled based on the selected background type.
  • Blur Radius and Sigma: Specify the intensity and spread of the blur effect (applicable if the blurred background type is selected).
  • Resize Ratio: Set the scale percentage to resize the image before applying effects to optimize performance and create the right effect you are looking for.
  • Gradient Direction: Choose the direction of the gradient fill, either vertical or horizontal (if gradient background type is selected).
  • Overlay Transparency: Set the transparency level for the overlay (if transparent overlay background style is selected).

Similar projects

Image Effects is the best in class modue that offer verity of effects. I want this module to be part of Image Effects one day.

Activity

Total releases
1
First release
Feb 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Release date
1.0.0-alpha3 Pre-release Feb 21, 2025