Repository navigation
Finnish specs per Police guide, clearer head guides, background removal strength, JPEG size limits - #1
Open
whcrg wants to merge 4 commits into
Open
Finnish specs per Police guide, clearer head guides, background removal strength, JPEG size limits#1whcrg wants to merge 4 commits into
whcrg wants to merge 4 commits into
Conversation
Check the Finnish passport, ID card and visa specs against the Finnish Police photo guide (Poliisin passikuvaohje 2020) and fix them: - Head height 32-36 mm (445-500 px online), not "at least 35 mm" (487 px), which was above the official maximum range. - Add the guide's other bounds: 4-6 mm above the crown, 7-9 mm below the chin, face centre line within 1.5 mm of the photo centre. - Online photos are 500x653 px = 36x47 mm, so use 352.8 dpi instead of 600 (which made them print at 21x28 mm). To express these, specs can now set maxHeadOffset, min/maxChinOffset and maxCenterOffset. Automatic framing keeps the crown and chin inside those bands, and the head guide draws them as min/max marker lines. The guide also gets a vertical centre line (with the allowed drift either side when a spec sets one), and every guide stroke is drawn as alternating black and white dashes so it stays visible on any photo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a spec has crown or chin bands, the head outlines now span them: the smallest head from the inner edge of the crown band to the inner edge of the chin band, the largest between the outer edges. For the Finnish specs that is exactly 32 and 36 mm. Add a "Background removal" slider (0-100%) to the retouch Background panel. Below 100% the original photo is blended back in under the cutout, so some of the original background shows through and the photo looks less processed. The cropper hands retouching the same crop of the original alongside the cutout. A note says authorities may still treat it as an edited photo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The crop area is measured on the cutout, which background removal may return at a different resolution from the original. Scale the original to the cutout's size before cropping it for the blend, and skip the blend (hiding the slider) when the two don't have the same shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Specs with an upload limit (rules.size, e.g. Finland online: 250 KB) were always saved as PNG and only warned when too large. Save them as JPEG instead, at the highest quality (0.95 down to 0.5, by binary search) that fits the limit, on white where the background is transparent. Online submissions such as the Finnish Police's expect JPEG anyway. The warning remains for the rare photo that still does not fit at the lowest quality. Other specs stay PNG with print density. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Checked the Finnish specs against the Finnish Police photo guide (Poliisin passikuvaohje 2020) and fixed them. Also clearer head guides, a background-removal strength slider, and JPEG output for specs with an upload size limit.
Finnish specs (passport, ID card, visa; paper and online)
The guide covers police-issued documents (passport, ID card, permits); the visa spec got the same values.
New optional spec rules to express this:
maxHeadOffset,minChinOffset,maxChinOffset,maxCenterOffset(fractions of photo height, like the existing ones). Automatic framing keeps the crown and chin inside those bands.Head guide
maxCenterOffsetis set.Background removal strength
A 0–100% slider in the retouch Background panel. Below 100% the same crop of the original photo is blended back under the cutout at
1 − removalopacity, which looks less processed. The original is scaled to the cutout's resolution before cropping (the crop area is measured on the cutout); if their shapes differ the slider is hidden. A note says authorities may still treat it as an edited photo. Strings added for all 15 locales (non-English ones not reviewed by native speakers).Upload size limits
Specs with
rules.size(e.g. Finland online, 250 KB) now save as JPEG at the highest quality (0.95 → 0.5, binary search) that fits, instead of always PNG with a warning. Transparent backgrounds go on white. The warning stays if even the lowest quality doesn't fit. Other specs are unchanged (PNG with print density).packages/mcp/distis rebuilt since it bundlessolveCrownand the spec data;check:distpasses.Testing
tsc, lint and tests pass forcommon(2,581 tests, including new placement, spec and size-encoding tests),webandmcp(84 tests).🤖 Generated with Claude Code