image2ascii icon indicating copy to clipboard operation
image2ascii copied to clipboard

Add an option to save the result

Open oyedejioyewole opened this issue 3 years ago • 3 comments

Please could you add the feature of saving the result of the image2ascii to a file. Doing this manually doesn't work as you use some kind of terminal color formatting, which makes the result in a file look ugly.

Thanks

oyedejioyewole avatar Jul 26 '22 14:07 oyedejioyewole

@OyewoleOyedeji how do you even get pipe output to work? When I try I just get NIL?

image2ascii -f frame_000.png -s -c=false > 0.txt
2023/10/28 18:25:14 <nil>

nicobleiler avatar Oct 28 '23 16:10 nicobleiler

I'm in the same boat now

image2ascii -f frame_000_delay-0.05s.jpg > out.txt
2023/11/10 13:16:12 <nil>

muradbu avatar Nov 10 '23 12:11 muradbu

I figured out it's due to the default options of the image dimensions.

type Options struct {
	Ratio           float64
	FixedWidth      int
	FixedHeight     int
	FitScreen       bool // only work on terminal
	StretchedScreen bool // only work on terminal
	Colored         bool // only work on terminal
	Reversed        bool
}

Specify a fixed width, height or ratio to make it work.

muradbu avatar Nov 10 '23 13:11 muradbu