Documentation
¶
Overview ¶
Package image provides image processing utilities for the OpenCode TUI.
This package includes functions for:
- Validating image file sizes before display
- Converting images to ANSI-art string representations for terminal display
- Image resizing using Lanczos algorithm for quality downscaling
The package uses the lipgloss library for terminal styling and the disintegration/imaging library for image processing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImagePreview ¶
ImagePreview loads an image file and converts it to an ANSI-art string. The image is resized to fit the specified width and rendered using ToString function. Returns the ANSI string or an error if loading fails.
func ToString ¶
ToString converts an image to an ANSI-art string representation. The image is first resized to the given width using Lanczos algorithm, then converted to a string using Unicode block characters (▀) with foreground and background colors to simulate the image in terminal. Each pair of vertical pixels is rendered as one block character.
Types ¶
This section is empty.