Skip to content
Merged
Show file tree
Hide file tree
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
Binary file added .github/social-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<p align="center">
<img src="https://raw.githubusercontent.com/ericstj/PrivacyFilter.Net/main/eng/icon.png" alt="PrivacyFilter.Net logo" width="128" height="128">
</p>
Comment on lines +1 to +3

# PrivacyFilter.Net

A managed C# port of the inference API and decoding pipeline from
Expand Down
Binary file added eng/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 72 additions & 0 deletions eng/make-icon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
"""Generates the PrivacyFilter.Net package icon (original artwork).

A rounded-square gradient badge containing a shield with text lines and a
highlighted sensitive span. Represents privacy-aware text filtering and
redaction. Intentionally distinct from any upstream logo.
"""
from pathlib import Path

from PIL import Image, ImageDraw

S = 512 # supersample, downscaled at the end
img = Image.new("RGBA", (S, S), (0, 0, 0, 0))
draw = ImageDraw.Draw(img)

# Vertical gradient background: indigo -> teal
top = (79, 70, 229) # #4F46E5
bot = (14, 165, 165) # #0EA5A5
for y in range(S):
t = y / (S - 1)
r = round(top[0] + (bot[0] - top[0]) * t)
g = round(top[1] + (bot[1] - top[1]) * t)
b = round(top[2] + (bot[2] - top[2]) * t)
draw.line([(0, y), (S, y)], fill=(r, g, b, 255))

# Rounded-square mask
radius = int(S * 0.22)
mask = Image.new("L", (S, S), 0)
ImageDraw.Draw(mask).rounded_rectangle([0, 0, S - 1, S - 1], radius=radius, fill=255)
img.putalpha(mask)

draw = ImageDraw.Draw(img)

white = (255, 255, 255, 255)
text = (79, 70, 229, 255)
accent = (245, 197, 66, 255)

# Shield - represents protection of sensitive text.
shield = [
(int(S * 0.50), int(S * 0.14)),
(int(S * 0.79), int(S * 0.25)),
(int(S * 0.76), int(S * 0.57)),
(int(S * 0.68), int(S * 0.72)),
(int(S * 0.50), int(S * 0.86)),
(int(S * 0.32), int(S * 0.72)),
(int(S * 0.24), int(S * 0.57)),
(int(S * 0.21), int(S * 0.25)),
]
draw.polygon(shield, fill=white)

# Text lines inside the shield. The accent bar represents detected/redacted PII.
lx = int(S * 0.33)
lh = int(S * 0.045)
line_radius = lh // 2
draw.rounded_rectangle(
[lx, int(S * 0.34), int(S * 0.68), int(S * 0.34) + lh],
radius=line_radius,
fill=text,
)
draw.rounded_rectangle(
[lx, int(S * 0.46), int(S * 0.71), int(S * 0.46) + int(S * 0.07)],
radius=int(S * 0.025),
fill=accent,
)
draw.rounded_rectangle(
[lx, int(S * 0.61), int(S * 0.61), int(S * 0.61) + lh],
radius=line_radius,
fill=text,
)

out = img.resize((128, 128), Image.Resampling.LANCZOS)
out.save(Path(__file__).with_name("icon.png"), "PNG")
print("wrote eng/icon.png")
Comment on lines +70 to +72
5 changes: 4 additions & 1 deletion src/PrivacyFilter.Net/PrivacyFilter.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@

<PropertyGroup Label="Packaging">
<PackageId>PrivacyFilter.Net</PackageId>
<Version>0.1.0</Version>
<Version>0.1.1</Version>
<EnablePackageValidation>true</EnablePackageValidation>
<PackageValidationBaselineVersion>0.1.0</PackageValidationBaselineVersion>
<Authors>ericstj</Authors>
<Description>Managed .NET inference API for OpenAI Privacy Filter, using the official ONNX model with o200k_base tokenization and constrained BIOES decoding.</Description>
<PackageTags>privacy;pii;redaction;token-classification;onnx;nlp;machine-learning</PackageTags>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>icon.png</PackageIcon>
<PackageProjectUrl>https://github.com/ericstj/PrivacyFilter.Net</PackageProjectUrl>
<RepositoryUrl>https://github.com/ericstj/PrivacyFilter.Net</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand All @@ -31,6 +33,7 @@

<ItemGroup>
<None Include="..\..\README.md" Pack="true" PackagePath="\" Link="README.md" />
<None Include="..\..\eng\icon.png" Pack="true" PackagePath="\" />
<None Include="..\..\THIRD-PARTY-NOTICES.md" Pack="true" PackagePath="\" />
</ItemGroup>

Expand Down