Add a option to trace color "by size"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
We got a lot of complaint @ inkscapeforum about color being dull after tracing.
I guess it's because of the color reduction algorithm.
I think we should provide an option to use a dumbest algorithm that will consider color only by their areas.
I think it will behave better on clipart image.
Here's a quick shell I wrote
It uses the histogram function of imagemagick to get the most significant colors and then it potraces every of them and join them in a final svg
#!/bin/bash
input=$1
output=$2
histogram=
tmpsvg="$2.tmp.svg"
tmpmask=
convert $input -format %c -depth 8 histogram:
sed -i '$d' "$histogram"
sort -n -k1,1 -r -o "$histogram" "$histogram"
echo "<?xml version='1.0' standalone='no'?>" > "$output" ;
echo "<svg version='1.0' xmlns='http://
i=1;
while IFS= read -r line; do
color=
echo "processing color $color $i"
i=$(($i+1))
convert "$input" \
-transparent "#$color" \
-alpha extract \
"$tmpmask"
potrace -s "$tmpmask" -o "$tmpsvg"
sed -ni '/transform/,/g>/p' "$tmpsvg"
sed -i "s/#000000/
cat "$tmpsvg" >> "$output"
done < "$histogram"
echo "</g></svg>" >> "$output"
rm "$histogram"
rm "$tmpsvg"
rm "$tmpmask"
Changed in inkscape: | |
importance: | Undecided → Wishlist |
status: | New → Confirmed |
tags: | added: preferences tracing |