File tree Expand file tree Collapse file tree
.oh-my-shell/shellrc/plugins/image Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,3 +7,7 @@ alias image_concat_vertically="convert -append "
77
88# Usage: concat_images_horizontally in1.jpg in2.jpg in3.jpg out.jpg
99alias image_concat_horizontally=" convert +append "
10+
11+ # Vectorize a raster image
12+ # Usage: image_raster_to_vector "/path/to/input.png" "/path/to/output.svg"
13+ alias image_raster_to_vector=" convert " $input_image " -threshold 50% -monochrome " $temp_pbm " "
Original file line number Diff line number Diff line change 1+ f_image_convert_raster_to_vector () {
2+ local input_file=" $1 "
3+ local output_file=" $2 "
4+ local pbm_file=" /tmp/$RANDOM .pbm"
5+
6+ # Convert to monochrome PBM using ImageMagick
7+ magick convert " $input_file " -threshold 50% -monochrome " $pbm_file "
8+ # Convert PBM to SVG using Potrace
9+ potrace -s -o " $output_file " " $pbm_file "
10+ # Clean up the intermediate PBM file
11+ rm " $pbm_file "
12+ }
You can’t perform that action at this time.
0 commit comments