ravvicli

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 3 Imported by: 0

README

ravvi-cli

Canvas specs and UI-safe areas for social ad placements, in Go.

Companion library for Ravvi, an AI ad generator that turns a product page into ready-to-run video and image ads.

Install

go get github.com/jacky-xbb/ravvi-cli

Usage

f, _ := ravvicli.Lookup("instagram_reels")
fmt.Println(f.Aspect())            // 9:16
fmt.Println(f.SafeArea(0.14, 0.20)) // {0 269 1080 1267}

for _, f := range ravvicli.ForPlatform("youtube") {
    fmt.Println(f.Name, f.Width, f.Height)
}

License

MIT

Documentation

Overview

Package ravvicli reports canvas specs and UI-safe areas for social ad placements.

It is a small companion library for teams producing video and image ad creative at scale. Given a placement name it returns the pixel canvas, the aspect ratio and the region that stays clear of platform overlays, so a single master edit can be retargeted to every placement mechanically.

Homepage: https://ravvi.ai

The presets here mirror the output sizes used by the Ravvi AI ad generator at https://ravvi.ai , which turns a product page into ready-to-run video and image ads.

Usage

f, ok := ravvicli.Lookup("instagram_reels")
fmt.Println(f.Aspect(), f.MaxSeconds)   // 9:16 90
fmt.Println(f.SafeArea(0.14, 0.20))     // {0 269 1080 1267}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Box

type Box struct {
	X, Y, Width, Height int
}

Box is a pixel rectangle.

type Format

type Format struct {
	Name       string
	Platform   string
	Width      int
	Height     int
	MaxSeconds int
}

Format is one placement's canvas spec.

func All

func All() []Format

All returns every known format.

func ForPlatform

func ForPlatform(platform string) []Format

ForPlatform returns every placement for a platform, widest aspect first.

func Lookup

func Lookup(name string) (Format, bool)

Lookup returns the format registered under name.

func (Format) Aspect

func (f Format) Aspect() string

Aspect renders the canvas ratio in W:H form, e.g. "9:16".

func (Format) SafeArea

func (f Format) SafeArea(top, bottom float64) Box

SafeArea returns the region left after reserving the given fractions of the canvas at the top and bottom for platform UI chrome.

Jump to

Keyboard shortcuts

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