# llimphi-image Decode pipeline for `peniko::Image`. Today a caller wanting to show an image with `View::image()` writes: ```ignore let reader = ImageReader::open(path)?.with_guessed_format()?; let img = reader.decode()?; let rgba = img.to_rgba8(); let (w, h) = (rgba.width(), rgba.height()); let blob = Blob::from(rgba.into_raw()); let pen = Image::new(blob, ImageFormat::Rgba8, w, h); ``` Five lines plus two `?` per caller (the nahual viewer, the mirada wallpaper, the gallery viewer, and so on). This crate encapsulates them in two helpers: - `decode_bytes` — takes `&[u8]` and returns `Result`. - `load_path` — takes a `&Path` plus a `max_bytes` cap and returns `Result`, with an on-disk size guard (apps do not want to read a 4 GB `.iso` thinking it is an image). With the `net` feature (opt-in, synchronous ureq) it adds download plus per-URL caching: `fetch_bytes`/`load_url` (blocking, to run in a worker) and `ImageCache` (`Clone + Send + Sync`) that the `view` consults on the UI thread while a `Handle::spawn` populates it. The base crate keeps no network dependency. The `image` (from the `image` crate) is always built with `to_rgba8` — the conversion `peniko::ImageFormat::Rgba8` requires. For an image already in `rgba8` in memory (no decoding needed) see `from_rgba8`. Formats: whatever the upstream `image` crate's features enable (in this workspace, today: PNG, JPEG, WEBP). Others can be turned on by adding the feature; the helper does not limit them. --- Part of **llimphi** — see [llimphi](../README.md).