Skip to content
Back to skills

Image Storage Embedding Split

ASecurity

Storing images at embed size loses the original:

  • 4 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 3, 2026
ai-agentsjavascriptjava

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add fabioc-aloha/Alex_Skill_Mall --skill image-storage-embedding-split --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Image Storage Embedding Split?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Image Storage Embedding Split
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/fabioc-aloha-image-storage-embedding-split/badge)](https://www.skillsdirectory.com/skills/fabioc-aloha-image-storage-embedding-split)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: image-storage-embedding-split
description: "Storing images at embed size loses the original:"
lastReviewed: 2026-04-30
---

# Image Storage vs Embedding Split

## The Problem

Storing images at embed size loses the original:

- Can't upscale later
- Can't use for different contexts
- Quality degradation is permanent

## The Solution

Keep originals at full resolution. Embed at reduced size.

```javascript
const sharp = require('sharp');

async function processImage(inputPath, outputDir) {
  const filename = path.basename(inputPath, path.extname(inputPath));
  
  // Store original at full resolution
  const original = await sharp(inputPath)
    .resize(512, 512, { fit: 'inside' })
    .toFile(path.join(outputDir, `${filename}-512.png`));
  
  // Create embed version at reduced size
  const embed = await sharp(inputPath)
    .resize(256, 256, { fit: 'inside' })
    .toBuffer();
  
  // Return both
  return {
    originalPath: path.join(outputDir, `${filename}-512.png`),
    embedDataUri: `data:image/png;base64,${embed.toString('base64')}`,
    embedSize: 256
  };
}
```

## Storage Schema

```json
{
  "images": [
    {
      "id": "avatar-001",
      "originalPath": "assets/avatar-001-512.png",
      "embedDataUri": "data:image/png;base64,iVBOR...",
      "embedSize": 256,
      "originalSize": 512
    }
  ]
}
```

## Token Savings

| Size | Base64 Size | Token Estimate |
|------|-------------|----------------|
| 512px | ~42KB | ~10,500 tokens |
| 256px | ~13KB | ~3,250 tokens |
| Savings | ~70% | ~7,250 tokens |

## Verification

1. Original file exists at full resolution
2. Embedded version is at reduced size
3. Schema documents both dimensions
4. Can regenerate embed from original

## When to Apply

- AI context windows with images
- Visual memory systems
- Any system with storage/display size trade-offs

## Tags

`images` `ai` `tokens` `storage`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…