Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Palette #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions noteshrink.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def get_palette(samples, options, return_mask=False, kmeans_iter=40):

def apply_palette(img, palette, options):

'''Apply the pallete to the given image. The first step is to set all
'''Apply the palette to the given image. The first step is to set all
background pixels to the background color; then, nearest-neighbor
matching is used to map each foreground color to the closest one in
the palette.
Expand Down Expand Up @@ -431,7 +431,7 @@ def apply_palette(img, palette, options):
def save(output_filename, labels, palette, dpi, options):

'''Save the label/palette pair out as an indexed PNG image. This
optionally saturates the pallete by mapping the smallest color
optionally saturates the palette by mapping the smallest color
component to zero and the largest one to 255, and also optionally sets
the background color to pure white.

Expand Down