Image Handling

Brandmine's comprehensive image management system for consistent, high-performance visuals.

Image Handling Overview

Our image handling system ensures consistent, high-quality visuals across the platform while maintaining optimal performance. This system covers organization, naming conventions, responsive sizing, optimization, and implementation.

Image Organization Structure

Images are organized by purpose and content type in a structured directory system:

assets/ └── images/ ├── brands/ # Brand-specific images │ └── [brand-name]/ # Each brand gets its own folder │ ├── originals/ # Original high-res images │ └── [generated responsive images] │ ├── site/ # Site-wide design elements │ ├── layout/ # Layout elements (headers, backgrounds) │ ├── icons/ # UI icons and small graphics │ ├── logos/ # Site logos and logomarks │ └── ui/ # UI elements (buttons, decorations) │ ├── pages/ # Page-specific images │ ├── home/ # Homepage images │ ├── about/ # About page images │ └── [other pages]/ # Other main sections │ ├── posts/ # Blog post images │ └── YYYY-MM-DD-post-slug/ # Folder per post │ ├── people/ # Team/people images │ ├── headshots/ # Professional portraits │ └── team/ # Group photos │ └── sectors/ # Sector/industry imagery ├── hotels/ # Hotel sector images ├── spirits/ # Spirits sector images └── [other sectors]/
text
assets/
└── images/
    ├── brands/             # Brand-specific images
    │   └── [brand-name]/   # Each brand gets its own folder
    │       ├── originals/  # Original high-res images
    │       └── [generated responsive images]
    │
    ├── site/               # Site-wide design elements
    │   ├── layout/         # Layout elements (headers, backgrounds)
    │   ├── icons/          # UI icons and small graphics
    │   ├── logos/          # Site logos and logomarks
    │   └── ui/             # UI elements (buttons, decorations)
    │
    ├── pages/              # Page-specific images
    │   ├── home/           # Homepage images
    │   ├── about/          # About page images
    │   └── [other pages]/  # Other main sections
    │
    ├── posts/              # Blog post images
    │   └── YYYY-MM-DD-post-slug/  # Folder per post
    │
    ├── people/             # Team/people images
    │   ├── headshots/      # Professional portraits
    │   └── team/           # Group photos
    │
    └── sectors/            # Sector/industry imagery
        ├── hotels/         # Hotel sector images
        ├── spirits/        # Spirits sector images
        └── [other sectors]/

Brand Image Organization

Brand images are organized by brand name, with each brand having its own directory:

assets/images/brands/teatime/
├── originals/
│ ├── hero-storefront.jpg
│ ├── gallery-teapot.jpg
│ └── profile-founder.jpg
├── teatime-hero-storefront-400w.jpg
├── teatime-hero-storefront-800w.jpg
├── teatime-hero-storefront-1200w.jpg
├── teatime-gallery-teapot-400w.jpg
└── ... etc

Image Naming Conventions

Brand Image Naming

Brand images follow this standardized naming pattern:

purpose-imagename.jpg
Original image naming pattern
brandname-purpose-imagename-widthw.jpg
Generated responsive image naming pattern
Examples:
hero-storefront.jpg
Original hero image of a storefront
teatime-hero-storefront-800w.jpg
Responsive version at 800px width

Standard Purpose Identifiers

Common purpose identifiers for image naming:

hero
Large banner images at the top of pages
gallery
Images shown in product or brand galleries
profile
Portraits of founders or team members
thumbnail
Smaller preview images for listings
feature
Images highlighting specific features
logo
Brand logos (preferably transparent PNG)
detail
Close-up shots showing product details
location
Photos of facilities, factories, or stores
product
Product photography

Non-Brand Image Naming

Non-brand images follow a similar pattern but may omit the brand component:

category-purpose-name-widthw.jpg
Non-brand image naming pattern
Examples:
home-hero-banner-1200w.jpg
Hero banner for the homepage
sector-hotels-header-800w.jpg
Header image for the hotels sector page
ui-button-primary-400w.png
UI element for a primary button

Responsive Image Sizes

All responsive images are generated in these standard widths:

400w
Mobile devices
800w
Tablets and smaller desktops
1200w
Standard desktop displays
1600w
(Optional) Large desktop displays and hero images

To maintain visual consistency across the platform, use these standard aspect ratios:

16:9
Hero banners, wide feature images
4:3
Standard content images, product shots
1:1
Profile pictures, thumbnails, gallery previews
3:4
Portrait-oriented images
2:1
Wide panoramic headers

Special Case: Logo Images

Logo images should be:

Image Optimization Process

Automation Workflow

The image processing workflow uses a custom script to generate responsive versions automatically:

  1. Place original high-resolution images in appropriate originals/ folder
  2. Name them according to the purpose-based naming convention
  3. Run the image processing script (scripts/resize_images.sh)
  4. Responsive versions are automatically generated in the correct sizes

Image Processing Script

The script, located at scripts/resize_images.sh, automatically:

bash
# Process images for a specific brand
./scripts/resize_images.sh teatime

# Process all brand images
./scripts/resize_images.sh

# Process all image categories
./scripts/process_all_images.sh

Quality Settings

Standard quality settings for optimal balance between file size and appearance:

JPEG quality
85% (good balance of quality and file size)
PNG compression
Optimized for file size
SVG
Minified when used for UI elements
bash
# From resize_images.sh script
convert "$IMG" -resize "${SIZE}x" -quality 85 "$BRAND_DIR/$OUTPUT_FILENAME"

Implementation in Jekyll

Responsive Image Includes

Jekyll includes make it easy to use responsive images throughout the site:

brand-image.html
For brand-specific imagery
site-image.html
For site-wide design elements and other images
liquid

<!-- For brand images -->

{% include brand-image.html 
   brand="teatime" 
   image="storefront" 
   purpose="hero"
   alt="TeaTime storefront in Moscow" 
   class="featured-image" %}


<!-- For non-brand images -->

{% include site-image.html 
   category="home"
   image="banner" 
   purpose="hero"
   alt="Brandmine connecting BRICS consumers" 
   class="full-width" %}

Brand Image Include Implementation

The brand image include automatically generates all the necessary HTML for responsive images:

html












<img src="/assets/images/brands//---400w.jpg"
     srcset="/assets/images/brands//---400w.jpg 400w, /assets/images/brands//---800w.jpg 800w, /assets/images/brands//---1200w.jpg 1200w"
     sizes="(max-width: 600px) 400px, (max-width: 1200px) 800px, 1200px"
     alt=""
     
     loading="lazy">

Usage Examples

Basic Usage:
{% include brand-image.html brand="teatime" image="storefront" purpose="hero" alt="TeaTime storefront in Moscow" %}
With Custom Classes:
{% include brand-image.html brand="teatime" image="teapot" purpose="gallery" alt="Signature teapot collection" class="rounded shadow-sm" %}
With Custom Sizes:
{% include brand-image.html brand="teatime" image="founder" purpose="profile" alt="Alexei Sokolov, TeaTime founder" sizes="(max-width: 768px) 100vw, 50vw" %}

Image Processing Tools

Several tools are available for image processing and optimization:

ImageMagick
Command-line tool for batch processing
Used in our automation scripts
Squoosh.app
Browser-based tool for manual optimization
Excellent UI
TinyPNG
Web service for simple compression
Good for quick batch optimization
XnConvert
Desktop app for batch processing
GUI for those who prefer visual tools
GIMP
Full image editor with batch capabilities
Good for editing and scripting

Image Requirements by Context

Different contexts require specific image characteristics:

Hero images
1600+ pixels wide, 16:9 aspect ratio, primary subject clearly visible
Brand logos
PNG format with transparency, available in light and dark versions
Headshots
1:1 aspect ratio, consistent framing (head and shoulders), neutral background
Product images
Clean background, consistent lighting, accurate colors
Gallery images
4:3 aspect ratio, minimum 1200px wide, consistent style within sets
Blog featured images
16:9 aspect ratio, minimum 1200px wide, relevant to the content

SEO Best Practices

For optimal SEO with images:

Descriptive filenames
Use relevant keywords separated by hyphens
Alt text
Provide meaningful alternative text for all images
Proper sizing
Avoid layout shifts by specifying dimensions
Image compression
Optimize file sizes for faster loading
Lazy loading
Implement for images below the fold
Structured data
Include schema markup for product images when appropriate
html
<!-- Example of SEO-optimized image -->
<img src="/assets/images/brands/teatime/teatime-product-premium-darjeeling-800w.jpg"
     alt="TeaTime Premium Darjeeling Tea - Organic loose leaf black tea from Darjeeling, India"
     width="800"
     height="600"
     loading="lazy">

Troubleshooting Common Issues

Image Processing Script Issues

"Command not found" error
Install ImageMagick with brew install imagemagick or relevant package manager
No images processed
Check that images are in correct originals/ folders with proper extensions
Permission denied
Make script executable with chmod +x scripts/resize_images.sh
Images not appearing correct size
Check CSS for any styling overriding dimensions

Jekyll Include Issues

Images not displaying
Verify paths and make sure relative_url filter is being used
Wrong sizes loading
Check the sizes attribute is appropriate for your layout
Missing images
Ensure image naming follows expected pattern in include
Images not responsive
Verify srcset is properly implemented and not overridden by CSS

Implementation Guidelines

Best Practices for Image Implementation

  1. Responsive images
    • Always use the responsive image includes
    • Provide appropriate sizes attribute for complex layouts
    • Test rendering on various device sizes
  2. Image quality
    • Start with high-quality source images
    • Keep original images in the originals/ folder
    • Let the optimization process handle resizing and compression
  3. Naming conventions
    • Follow the established purpose-based naming patterns
    • Use descriptive, keyword-rich filenames
    • Be consistent with naming across the site
  4. Alt text
    • Provide meaningful alternative text for all images
    • Include relevant keywords naturally
    • Describe the image content and purpose
  5. Performance optimization
    • Implement lazy loading for images below the fold
    • Avoid unnecessarily large images
    • Use appropriate image formats (JPEG for photos, PNG for logos)
  6. Process automation
    • Use the provided scripts for image processing
    • Maintain the directory structure
    • Follow the workflow for adding new images