jewelcase

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2025 License: MIT Imports: 15 Imported by: 0

README

jewelcase

Banner

Tired of your album art having different aspect ratios? Want to make your music collection look more physical? Just nostalgic for the turn of the millennium? Meet jewelcase, a silly little program that transforms an image to look like it's printed and carefully slotted inside a CD jewel case.

Usage

Add an effect and save as a new file:

go run github.com/csmith/jewelcase/cmd/jewelcase@latest input.jpg output.jpg

Add an effect and save the file in-place

go run github.com/csmith/jewelcase/cmd/jewelcase@latest --inplace input.jpg

Find all images recursively in a directory and add an effect to them all

go run github.com/csmith/jewelcase/cmd/jewelcase@latest --recursive ./folder

By default jewelcase won't process any images that are the exact size of its output (884×777 pixels), so you can safely use --recursive across your entire library repeatedly without ending up with jewel cases inside jewel cases. You can override this behaviour by passing the --force parameter.

Use --quiet to suppress "skipped" messages when using --recursive:

go run github.com/csmith/jewelcase/cmd/jewelcase@latest --recursive --quiet ./folder

Effects

Example Description
Original Original album art without jewel case
Everything Jewel case with no effects applied
Colour Colour adjustment (--colour=false to disable)
Corners Rounded corners (--corners=false to disable)
Edges Edge softening (--edges=false to disable)
Offset Random offset (--offset=false to disable)
Rotation Random rotation (--rotation=false to disable)
Reflection Reflection effect (--reflection=false to disable)
Everything All effects enabled (default)

Provenance

This project was primarily created with Claude Code, but with a strong guiding hand. It's not "vibe coded", but an LLM was still the primary author of most lines of code. I believe it meets the same sort of standards I'd aim for with hand-crafted code, but some slop may slip through. I understand if you prefer not to use LLM-created software, and welcome human-authored alternatives (I just don't personally have the time/motivation to do so).

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyProcessed = errors.New("image appears to be already processed")

ErrAlreadyProcessed is returned when an image appears to already have the jewel case effect applied.

Functions

func Process

func Process(albumArt image.Image, opts Options) (image.Image, error)

Process applies the jewel case frame and effects to the provided album art image. The input image is scaled and cropped to fit the frame, then various effects are applied based on the provided Options. Returns ErrAlreadyProcessed if the image appears to already be processed (unless opts.Force is true). Returns the final framed image.

func ProcessFile

func ProcessFile(inputPath, outputPath string, opts Options) error

ProcessFile applies the jewel case effect to an image file and saves the result. Reads from inputPath, applies effects, and writes to outputPath. The output format is determined by the outputPath extension. Supports JPEG and PNG output formats.

Types

type Options

type Options struct {
	// ColourCorrection applies subtle saturation and contrast reduction with a blue tint
	ColourCorrection bool

	// RoundedCorners applies randomly-sized rounded corners to the image
	RoundedCorners bool

	// EdgeSoftening applies alpha transparency to the edges for a softer look
	EdgeSoftening bool

	// RandomOffset applies a small random positional offset when placing the image in the frame
	RandomOffset bool

	// RandomRotation applies a subtle random rotation to the image
	RandomRotation bool

	// Reflection adds a diagonal white highlight to simulate light reflection
	Reflection bool

	// Force processes images even if they appear to already be processed
	Force bool
}

Options controls which visual effects are applied to the album art.

Directories

Path Synopsis
cmd
jewelcase command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL