about summary refs log tree commit diff stats
path: root/doc/image.md
Commit message (Collapse)AuthorAgeFilesLines
* Update docsbptato2025-01-151-1/+1
|
* Update docsbptato2024-12-271-1/+1
| | | | | Licenses now ordered by "explicitly PD", "PD-equivalent" and "not PD-equivalent".
* img: add nanosvgbptato2024-12-191-0/+1
| | | | | | | | | | | | | | | | | | Only for SVG in image tags for now. Plus it comes with NanoSVG's limitations, i.e. no text. Still, better than nothing. I've gone through open tickets and PRs at upstream to check for known security issues. As a recurring theme I found that parseTransform fails to check the result of parseTransformArgs, so I fixed and refactored that part. (Probably not a security issue, but still UB.) Also, I've added a fix for an OOB read in parseColorRGB. Future directions: * replace nanosvgrast with our own rasterizer in canvas (will have to be extended somewhat...) * add text rendering (with unifont, which canvas already includes)
* Update docsbptato2024-11-201-5/+5
|
* config: refactor, accept more possible config dirsbptato2024-10-281-1/+1
| | | | | | | | | | | | | | | | | | | | | I'm starting to favor dotfiles over XDG basedirs, but there's no reason why we couldn't have both. So now the search path is: 0. if config was set through -C, use that 1. $CHA_CONFIG_DIR is set -> $CHA_CONFIG_DIR/config.toml 2. $XDG_CONFIG_HOME is set -> $XDG_CONFIG_HOME/chawan/config.toml 3. ~/.config/chawan/config.toml exists -> use that 4. ~/.chawan/config.toml exists -> use that Notably, this makes it so the default directory is ~/.chawan *if* you don't have an existing config.toml file. So in that case known_hosts will be placed in ~/.chawan/known_hosts. However, configurations with a config in ~/.config/chawan/config.toml continue to work as expected, as for those the known_hosts file remains inside ~/.config/chawan/. Finally, I've added a default user CGI directory to reduce friction in setting CGI up. (Like known_hosts, it's also relative to whatever config dir you have.)
* Update docsbptato2024-10-231-2/+4
|
* Update docsbptato2024-10-151-7/+22
|
* sixel: support transparencybptato2024-09-241-16/+17
| | | | | | | | | | | | | | | | | | Sixel can only represent transparency for fully transparent (alpha = 0) and fully opaque (alpha = 255) pixels, i.e. we would have to do blending ourselves to do this "properly". But what do you even blend? Background color? Images? Clearly you can't do text... So instead of going down the blending route, we now just approximate the 8-bit channel with Sixel's 1-bit channel and then patch it up with dither. It does look a bit weird, but it's not *that* bad, especially compared to the previous strategy of "blend with some color which hopefully happens to be the background color" (it rarely was). Note that this requires us to handle transparent images specially in term. That is, for opaque ones, we can leave out the "clear cells affected by image" part, but for transparent ones, we must clear the entire image every time.
* loader: mmap intermediate image files, misc refactoringbptato2024-09-221-36/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | * refactor parseHeader * optimize response blob() * add direct "to cache" mode for loader requests which sets stdout to a file, and use it for image processing * move image resizing into a separate process * mmap cache files in between processing steps when possible At last, resize is no longer a part of image decoding. Also, it feels much nicer to keep encoded image data in the same cache as everything else. The mmap operations *should* be more efficient than copying the whole RGBA data through a pipe. In practice, it only makes a difference for loading (well, now just mmapping) the encoded image into the pager, where it singlehandedly speeds up image display by 10x on my test image. For the other steps, the unfortunate fact that "tocache" must delay the next fork/exec in the pipeline until the entire image is processed seems to equal out any wins we might have gotten from skipping a single raw RGBA copy. I have tried moving the delay before the exec (it's possible with yet another pipe), but it didn't help much and made the code much uglier. (Not that tocache didn't, but I can live with this...)
* Update docsbptato2024-09-131-4/+36
|
* doc: update manpagesbptato2024-09-021-3/+7
|
* sixel: proper color quantizationbptato2024-08-271-1/+1
| | | | | | | | just use an octree. works fine afaict, though obviously somewhat slower than the static method (encoding is 2-pass now) & still has banding issues with many colors (will need dithering) also, fixed a bug that caused initial masks of bands to get misplaced
* Add image docsbptato2024-08-251-0/+143
Somewhat rough, but better than nothing.