image_protocol is only consulted inside the use_color branch of run() (src/main.rs:310-322), and use_color is true whenever --color=always is passed regardless of whether stdout is a terminal. So:
mdriver --color=always --images kitty README.md > out.md
writes megabytes of base64-encoded kitty escape sequences into the output file.
Image rendering should require io::stdout().is_terminal() independently of the color decision — colors are still meaningful when piped (that's the point of --color=always | less -R), but graphics protocol escapes never are.
image_protocolis only consulted inside theuse_colorbranch ofrun()(src/main.rs:310-322), anduse_coloris true whenever--color=alwaysis passed regardless of whether stdout is a terminal. So:writes megabytes of base64-encoded kitty escape sequences into the output file.
Image rendering should require
io::stdout().is_terminal()independently of the color decision — colors are still meaningful when piped (that's the point of--color=always | less -R), but graphics protocol escapes never are.