# Image generation test plan — ImageSharp-only (multiplatform)
Goal
-----
Create an automated, cross-platform test project that validates `ImageCreatorImageSharp` behavior by generating synthetic input images and pixel-inspecting outputs produced by the library.
Decisions
---------
- Test only `ImageCreatorImageSharp` (multiplatform).
- Test project targets `net10.0` (not Windows-only) and uses SixLabors.ImageSharp for both generation and verification; avoid `System.Drawing.Common` in tests.
- Inputs are programmatically generated images (no checked-in large binaries).
-`TempWorkspace` — creates temporary `Source` and `Dest` folders, cleans up on dispose.
-`TestImageFactory` — creates synthetic JPEG/PNG inputs and in-memory logo PNG bytes. Also can write EXIF orientation values.
-`PixelInspector` — loads output using ImageSharp and exposes:
-`CountNonBackgroundPixels(path, Rectangle region, Rgba32 background, int tolerance)`
-`SampleAverageColor(path, Rectangle region)`
- Region helpers: top/bottom/left/right/center/quadrant rectangles for given image sizes
-`CreatorFactory` — builds `PicSettings` defaults and `ImageCreatorImageSharp` instances.
Test cases (high-level)
-----------------------
1. Image resizing: verify big and small output dimensions respect settings.
2. Text positioning: for `Posizione` = ALTO/CENTRO/BASSO and `Allineamento` = SINISTRA/CENTRO/DESTRA assert text pixels appear in expected regions.
3. Text content: baseline (empty) vs non-empty comparisons to ensure text changes output; EXIF-vertical photo selects `TestoFirmaV`.
4. Logo positioning: use a solid-color logo (e.g., pure red PNG) and verify red pixels appear in the expected quadrant for combinations of `LogoPosizioneH`×`LogoPosizioneV` and with margins (absolute and percentage).
5. Logo features: opacity (logo color blending) and color-key transparency.
6. EXIF orientation: ensure rotation is applied and output contains no EXIF orientation tag.
Verification approach
---------------------
- For text: compare non-background pixel count in the target band vs opposite band (thresholded) to avoid brittle exact glyph placement checks.
- For logo: sample the quadrant where the logo should be; count logo-colored pixels and assert above threshold.
- For opacity: sample average color in logo region and assert it is blended when opacity <100%.
Scope boundaries
----------------
- In scope: `ImageCreatorImageSharp` behavior: resize, EXIF rotation, text presence/position, logo position/opactiy, thumbnails.