-
-
Notifications
You must be signed in to change notification settings - Fork 659
feat: Add image comparison tool with slider overlay #2238
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
base: develop
Are you sure you want to change the base?
Conversation
Implements a new tool for comparing two images using a draggable slider overlay that splits the view between left (A) and right (B) images. Core functionality: - Slider-based split view (drag to reveal left/right images) - Click anywhere to reposition slider - Synchronized zoom and pan for both images - Keyboard shortcuts: Backspace (reset slider), ` (reset zoom/pan) - Handle can be moved vertically along the slider line Image loading: - Ctrl+click thumbnail in gallery to set comparison image (B) - Mouse wheel over right pane cycles through comparison images - Drag & drop files onto either pane with visual feedback UI integration: - Menu: Layout > Compare images - Hotkey: Alt+M - Toolbar button with new Compare icon - A/B badges on gallery thumbnails indicate main/comparison images Technical: - D2D rendering for raster image comparison - WebView2 rendering for SVG comparison (with mixed SVG/raster support) - Dynamic switching between renderers based on image type - Image-based slider positioning (follows zoom/pan transforms)
Display "Compare: image.png ⇄ compare.png" in the title bar when comparison mode is active, followed by the normal image info.
|
Thanks @camjac251 for the PR. Gimme some time to review it :) |
|
I found a bug: When comparing two GIF files, the second GIF file is not displayed. Examples: To test, you can use two animated GIF images. |
- Fix PhotoCodec.ReadWithStream ignoring FirstFrameOnly option for animated formats (GIF, GIFV, WEBP, B64), which caused comparison image to be null - Extend ShouldUseWeb2ForComparison to detect animated formats and use WebView2 mode for proper animation support - Modify ReadImageAsHtmlAsync to return null for animated formats, allowing direct file URL usage instead of base64 overhead
|
Thanks for testing. I missed that bug, it's now rendering GIFs in WebView2 now instead, and they're animated during comparison |
|
English:
Portuguese:
|
Move duplicated animatedExtensions array to Const.ANIMATED_FORMATS for single source of truth across comparison mode code paths.
- Disable rotate/flip/invert/color channel features during comparison mode with user-friendly message (features would only affect one image) - Fix pan without zoom bug in WebView2 comparison mode - images can no longer be dragged when at 1x zoom, panning constrained to image bounds - Fix zoom clipping bug - reset zoom/pan when comparison images change to prevent new image from being "stuck" in previous transform state Addresses feedback from PR d2phap#2238 review.
d58bff1 to
4daa2ee
Compare
|
Thanks @JADERLINK for the detailed bug report and video! I've pushed fixes for the issues you identified: Fixed:
Not addressed:
Note: I wasn't able to build and test these changes due to an antivirus false positive deleting a NuGet package (microsoft.windows.sdk.win32metadata). The fixes should work based on code review, but I'll confirm once I resolve the local build issue. |
|
Thanks for update @camjac251
Selection in Crop tool with
|
- Fix DPI scaling for comparison slider (handle, line, hit areas) - Round slider position to pixel boundary to avoid cutting through pixels - Add hover area along full separator line height (not just handle) - Disable crop tool during comparison mode - Style handle like crop tool resizers (double ellipse with shadow)
|
Thanks for the detailed feedback @d2phap Pushed fixes for the UI/UX issues:
The handle is also now styled like crop tool resizers (double ellipse with shadow effect for consistency). Note: Still unable to build/test locally due to the antivirus issue with the NuGet package. |


Closes #636
Summary
Adds A/B image comparison with a draggable slider overlay that splits the view between two images.
How to use
Alt+MCtrl+clicka thumbnail in the gallery, orAlt+scrollover right pane to cycle through imagesControls
Technical notes