Python Image Morpher Versions Save

Python Image Morpher (PIM) is a program that blends images to your content!

v2.0.2

2 years ago

This update includes dependency changes. Please run the command "pip install -r requirements.txt" or equivalent after downloading.

Added

  • Configuration Tab (Work in Progress)
    • Initial GUI implementation for saving, loading, and handling default parameters requested by the user, such as default image search path
    • All widgets are currently disabled and will be enabled in a future update when ready

Changes

  • Image loading methods loadDataLeft() and loadDataRight() now default to the Images_Points folder when the user is prompted to select an image
    • This will be configurable when the Configuration tab is fully implemented and released
  • Code cleanup: Merged and removed duplicate methods for various GUI tasks to reduce unnecessary bloat - more planned in the future
    • updateRed() / updateGreen() / updateBlue()updateColorSlider
    • triangleRedValueDone() / triangleGreenValueDone() / triangleBlueValueDone() → Removed in favor of directly calling verifyValue
  • Rewrote checkUpdate() to instead parse api.github.com as well as silently terminate on exception or failure
  • Modified requirements.txt:
    • Added Requests - missing from 2.0 release, required for checkUpdate()
    • Removed BeautifulSoup - no longer needed due to checkUpdate() changes
  • Miscellaneous: Updated comments for initialized GUI variables and signal connections

v2.0.1

2 years ago

Fixes

  • Resolved crash when the total point pair count was brought below three through Delete Mode
  • Corrected issue with Delete Mode that caused points to be improperly deleted (eventually cascaded into crashes)
  • Fixed bug with image loading that caused PIM to crash when only one point pair was previously saved
  • Removed unnecessary print statement on startup

v2.0.0

2 years ago

As no issues have been reported with 2.0.0 Beta, it is now being released as Stable with a couple additions.

This update includes new dependencies - Please run the command "pip install -r requirements.txt" or equivalent after downloading.

Added

  • New Mouse Modes
    • In addition to point placement, the user can now switch to two other modes when clicking on images: Move Mode and Delete Mode
      • (E) - Move Mode allows the user to drag any previously confirmed point to a new location
      • (Q) - Delete Mode allows the user to delete any previously confirmed point
      • Special thanks to GitHub user jankaWIS for creating this feature request
  • Dynamic Image Loading
    • The user can now load images into the GUI from their OS by dragging and dropping them into the desired window
    • Input images are now dynamically resized to match the size of their windows in the GUI, greatly improving GUI responsiveness
      • Larger images (e.g. 1080p, 4K, etc.) are downscaled, smaller images are upscaled
      • The user's files themselves are unchanged - PIM instead manipulates copies that get cleaned up during termination
  • Zoom Panning
    • The user can now pan images while zoomed in by clicking and dragging with the middle-mouse button
  • Zoom Slider
    • QoL: The user can now manually set the strength of the zoom applied to GUI images (in realtime) for ease of use
      • Zoom strength is defaulted to 2x during initialization but can now range from 2x to 10x!
  • Automatic Versioning Checker
    • On startup, PIM now checks your currently installed version against the latest stable release hosted on GitHub
    • A prompt is provided to automatically navigate the user to the latest release, if not up to date
      • PIM does not support automatic update installation at this time
  • Triangle Widget Enhancements
    • In addition to the sliders, the user can now manually enter RGB values for the displayed triangles
      • The user can now choose between binary, decimal, or hexadecimal format when setting RGB values
  • More Macros
    • The following key combinations have been added to support the user's interactions with the GUI:
      • D = Toggle Display of Delaunay Triangles
      • E = Toggle Move Mode (for moving individual points)
      • Q = Toggle Delete Mode (for deleting individual points)
      • Ctrl + Mouse Wheel = Adjust Zoom Slider
      • Shift + Mouse Wheel = Adjust Point Slider
      • Alt + Mouse Wheel = Adjust Alpha Slider

Changes

  • PIM's GUI has received many needed internal changes. The following elements have been changed:
    • Redesign:
      • The GUI has been restructured from scratch to containerize separate blocks
        • As this allows for far more refined control over resizing behavior - which has historically been a very problematic piece of development for this project - EVERY documented resizing bug has been fixed with this change (more details in Fixes)
    • Miscellaneous:
      • Minimum size of the main window has changed from (788 x 690) to (844 x 763)
  • Optimization: MorphingApp.py no longer conditionally sets size rules for the image windows (as Qt handles resizing correctly now)
  • Complete rewrite of blendImages() to support proper QThreading during morphing, preventing GUI lockup
    • To accompany this change, all functions related to morphing are disabled during the process to prevent exploits
  • Implemented a proper progress bar for full blending - the notification bar is no longer used for this
  • Full blending now displays frames as they are rendered
    • PIM will still display the user's specified frame when finished morphing
  • Alpha is now assigned 50% instead of 0% when reset
  • PIM now prompts for confirmation when the Reset Points button is pressed
  • Added queue & warnings to MorphingApp.py's imports
  • Removed Matplotlib and itertools from Morphing.py's imports
    • As it was a dependency that is no longer in use, removed Matplotlib from requirements.txt as well
  • Added pynput, beautifulsoup, & opencv-python to requirements.txt
  • Added version.txt to facilitate automatic versioning checks.
  • Removed NumPy's version restriction in requirements.txt (as the fmod() issue in v1.19.4 has been resolved)
  • Simplified all remaining instances of legacy code where the last index of a list was being accessed
    • x[len(x)-1] → x[-1]
  • Removed an instance of self.repaint() inside MorphingApp.py's checkResize()
  • Removed multiple instances of self.refreshPaint() inside MorphingApp.py's keyPressEvent()
  • Updated README.md
  • And much, much more

Fixes

  • Every single documented resizing bug has been hit with this update's GUI changes, including but not limited to:
    • Fixed: Input images would expand (or rarely shrink) by 2 pixels when loaded or each time the GUI was resized (very common)
    • Fixed: The bottom half of the GUI would often vertically expand/collapse before the top half (very common)
    • Fixed: The left half of the GUI would often horizontally expand/collapse before the right half (uncommon)
    • Fixed: Zooming into input images would cause random, incorrect resizing behavior (common)
    • Fixed: When maximized, the GUI would resize incorrectly with conditionally varying severity (very common)
    • Fixed: Inconsistent resizing behavior before and after a morph had been executed (very common)
  • Fixed a long-standing bug where the GUI could temporarily become unresponsive while morphing
    • Additionally, fixed a bug where inputs to the GUI would be propagated during morphing
      • Example: This could lead to chain-morphing if the blend button was clicked more than once
  • Fixed a bug where PIM could treat certain incompatible images as standard .jpg, causing a crash during morphing
  • Fixed a bug where zooming in on the lower third of either input image would be visibly distorted
  • Prioritized GUI parameter assignment to come first in the loadImage functions - thereby resolving several bugs & crashes
  • Fixed an amusing bug where the Help tab could be edited by the user
  • Fixed a crash that could occur upon resetting the alpha slider after executing a full blend
  • Resolved a minor GUI issue where, when enabled, Green/Blue triangle color value text would remain grey until updated
  • Fixed a bug where the Add Corners button would sometimes not enable after clicking Resize Left Image or Resize Right Image
  • Corrected a notification bar bug when one image has been loaded and user tries to add point
  • Other general code cleanup

Known Bugs

  • While zoomed in, issue with highlighting points to be manually moved or deleted
  • After clicking Resize Left/Right, points on the GUI do not visibly scale correctly
    • Comment: This is a purely visual bug. For now, this issue can be circumvented by just reloading the affected image.

Unreleased

  • Key Macro: Tab / Shift + Tab = Switch Morphing Tab
  • Configuration Tab
    • Comment: In the future, this tab will be used to set/reload default parameters for PIM to use on initialization. Still planning out what I do and don't want to be included in this tab though, so it has been excluded from this release.

v2.0-beta

2 years ago

This beta includes new dependencies - Please run the command "pip install -r requirements.txt" or equivalent after downloading.

Added

  • New Mouse Modes
    • In addition to point placement, the user can now switch to two other modes when clicking on images: Move Mode and Delete Mode
      • (E) - Move Mode allows the user to drag any previously confirmed point to a new location
      • (Q) - Delete Mode allows the user to delete any previously confirmed point
      • Special thanks to GitHub user jankaWIS for creating this feature request
  • Dynamic Image Loading
    • The user can now load images into the GUI from their OS by dragging and dropping them into the desired window
    • Input images are now dynamically resized to match the size of their windows in the GUI, greatly improving GUI responsiveness
      • Larger images (e.g. 1080p, 4K, etc.) are downscaled, smaller images are upscaled
      • The user's files themselves are unchanged - PIM instead manipulates copies that get cleaned up during termination
  • Zoom Panning
    • The user can now pan images while zoomed in by clicking and dragging with the middle-mouse button
  • Zoom Slider
    • QoL: The user can now manually set the strength of the zoom applied to GUI images (in realtime) for ease of use
      • Zoom strength is defaulted to 2x during initialization but can now range from 2x to 10x!
  • Triangle Widget Enhancements
    • In addition to the sliders, the user can now manually enter RGB values for the displayed triangles
      • The user can now choose between binary, decimal, or hexadecimal format when setting RGB values
  • More Macros
    • The following key combinations have been added to support the user's interactions with the GUI:
      • D = Toggle Display of Delaunay Triangles
      • E = Toggle Move Mode (for moving individual points)
      • Q = Toggle Delete Mode (for deleting individual points)
      • Ctrl + Mouse Wheel = Adjust Zoom Slider
      • Shift + Mouse Wheel = Adjust Point Slider
      • Alt + Mouse Wheel = Adjust Alpha Slider

Changes

  • PIM's GUI has received many needed internal changes. The following elements have been changed:
    • Redesign:
      • The GUI has been restructured from scratch to containerize separate blocks
        • As this allows for far more refined control over resizing behavior - which has historically been a very problematic piece of development for this project - EVERY documented resizing bug has been fixed with this change (more details in Fixes)
    • Miscellaneous:
      • Minimum size of the main window has changed from (788 x 690) to (844 x 763)
  • Optimization: MorphingApp.py no longer conditionally sets size rules for the image windows (as Qt handles resizing correctly now)
  • Complete rewrite of blendImages() to support proper QThreading during morphing, preventing GUI lockup
    • To accompany this change, all functions related to morphing are disabled during the process to prevent exploits
  • Implemented a proper progress bar for full blending - the notification bar is no longer used for this
  • Full blending now displays frames as they are rendered
    • PIM will still display the user's specified frame when finished morphing
  • Alpha is now assigned 50% instead of 0% when reset
  • PIM now prompts for confirmation when the Reset Points button is pressed
  • Added queue & warnings to MorphingApp.py's imports
  • Removed Matplotlib and itertools from Morphing.py's imports
    • As it was a dependency that is no longer in use, removed Matplotlib from requirements.txt as well
  • Added pynput and opencv-python to requirements.txt
  • Removed NumPy's version restriction in requirements.txt (as the fmod() issue in v1.19.4 has been resolved)
  • Simplified all remaining instances of legacy code where the last index of a list was being accessed
    • x[len(x)-1] → x[-1]
  • Removed an instance of self.repaint() inside MorphingApp.py's checkResize()
  • Removed multiple instances of self.refreshPaint() inside MorphingApp.py's keyPressEvent()
  • Updated README.md
  • And much, much more

Fixes

  • Every single documented resizing bug has been hit with this update's GUI changes, including but not limited to:
    • Fixed: Input images would expand (or rarely shrink) by 2 pixels when loaded or each time the GUI was resized (very common)
    • Fixed: The bottom half of the GUI would often vertically expand/collapse before the top half (very common)
    • Fixed: The left half of the GUI would often horizontally expand/collapse before the right half (uncommon)
    • Fixed: Zooming into input images would cause random, incorrect resizing behavior (common)
    • Fixed: When maximized, the GUI would resize incorrectly with conditionally varying severity (very common)
    • Fixed: Inconsistent resizing behavior before and after a morph had been executed (very common)
  • Fixed a long-standing bug where the GUI could temporarily become unresponsive while morphing
    • Additionally, fixed a bug where inputs to the GUI would be propagated during morphing
      • Example: This could lead to chain-morphing if the blend button was clicked more than once
  • Fixed a bug where PIM could treat certain incompatible images as standard .jpg, causing a crash during morphing
  • Fixed a bug where zooming in on the lower third of either input image would be visibly distorted
  • Prioritized GUI parameter assignment to come first in the loadImage functions - thereby resolving several bugs & crashes
  • Fixed an amusing bug where the Help tab could be edited by the user
  • Fixed a crash that could occur upon resetting the alpha slider after executing a full blend
  • Resolved a minor GUI issue where, when enabled, Green/Blue triangle color value text would remain grey until updated
  • Fixed a bug where the Add Corners button would sometimes not enable after clicking Resize Left Image or Resize Right Image
  • Corrected a notification bar bug when one image has been loaded and user tries to add point
  • Other general code cleanup

Known Bugs

  • While zoomed in, issue with highlighting points to be manually moved or deleted
  • After clicking Resize Left/Right, points on the GUI do not visibly scale correctly
    • Comment: This is a purely visual bug. For now, this issue can be circumvented by just reloading the affected image.

Unreleased

  • Key Macro: Tab / Shift + Tab = Switch Morphing Tab
  • Configuration Tab
    • Comment: In the future, this tab will be used to set/reload default parameters for PIM to use on initialization. Still planning out what I do and don't want to be included in this tab though, so it has been excluded from this release.

v1.1.2

3 years ago

Hotfix:

  • Fixed a bug where the absolute path to Images_Points was incorrectly assigned for non-Windows machines
    • '\\' → os.path.sep

v1.1.1

3 years ago

Hotfix:

  • Fixed a bug where starting/ending image names could be incorrectly assigned when certain OS conditions were met
    • re.search('(?<=[/])[^/]+(?=[.])', x).group() → os.path.splitext(os.path.basename(x))

v1.1.0

3 years ago

Known Bugs

  • The GUI can sometimes become unresponsive during morphing calculations (but eventually returns to normal)
    • QtCore.QCoreApplication.processEvents() is a potential workaround but currently produces buggy results

Added

  • Point Size Slider
    • QoL: The user can now manually change the size of points rendered onto the GUI (in realtime) for ease of use
    • Point width values still default to 4 during initialization but can now range from 1 to 10

Changes

  • PIM's GUI has received another facelift with this update! The following elements have been changed:
    • Redesign:
      • Along with a streamlined layout, buttons & settings have been moved to categorized tabs
    • Accessibility:
      • PIM now includes a Help manual for new users! Check the Help tab in the GUI for more.
      • Minimum size of the main window has changed from (878 x 809) to (788 x 690)
    • Miscellaneous:
      • Added dedicated value boxes for each of the triangle color sliders
        • Changes in value will no longer be announced in the notification bar
      • Alpha is now initialized at 50% instead of 0%

Fixes

  • Fixed an ugly bug where zooming in to only one image could reshape the GUI
  • Fixed a notification bar bug regarding mouse clicks when only one image was loaded

v1.0.0

3 years ago

See here for the full list of changes.

Known Bugs

  • The GUI can sometimes become unresponsive during morphing calculations (but eventually returns to normal)
    • QtCore.QCoreApplication.processEvents() is a potential workaround but currently produces buggy results

Added

  • Image Zoom - Because sometimes, it's hard to get that one point just right.
    • The user can now right click on either [or both] of the input images to toggle zoom for more accurate point placement

Removed

  • As of v0.3.0.1's hot pixel fix, PIM's image smoothing feature is deprecated and will now be removed
    • Removed Morphing.py's smoothBlend() method as well as the "smoothMode" parameter in getImageAtAlpha()
    • Removed Morphing.py's sub-module import for SciPy's median_filter
    • Removed all code related to smoothing in MorphingApp.py (a reduction of 77 SLOC)
    • Removed self.smoothingBox from MorphingGUI.ui and MorphingGUI.py

Changes

  • Improved morphing performance (a huge 90% speedup) by modifying Morphing.py's implementation of getPoints() as well as tweaking interpolatePoints() to utilize RectBivariateSpline's .ev() method instead of manually interpolating the image data
    • Huge thanks to GitHub user zhifeichen097 for his source code which can be found here - excellent work!
  • Optimized the conditional logic found in MorphingApp.py's displayTriangles()
  • Optimized point assignment in Morphing.py's loadTriangles() by utilizing np.loadtxt()
  • Optimized conditional logic and list pop statements in MorphingApp.py's keyPressEvent()
  • Changed the loop in MorphingApp.py's autoCorner() to be less C-like and more Pythonic
    • "i = 0; while i < 4: ... i++" → "for leftPoint, rightPoint in zip(tempLeft, tempRight): ..."
  • Moved autoCorner()'s invocation of refreshPaint() out of it's loop (i.e. the GUI is now updated once instead of up to four times)
  • Changed the notification message displayed when autoCorner() adds one point pair
  • Removed a conditional in MorphingApp.py's resizeLeft() and resizeRight() that was unnecessarily reassigning their image type variable
  • Converted the syntax of all instances where lists were being reset in MorphingApp.py
    • "self.blendList = []" → "self.blendList.clear()"

Fixes

  • Resolved an oversight where .jpeg images couldn't be loaded into the program
    • Comment: To clarify, while it can probably accept other types, PIM is specifically written to work with .jpg, .jpeg, and .png images.
  • Corrected unintended behavior in mousePressEvent() where points could also be drawn with the middle and right mouse buttons

v0.3.0.1

3 years ago

Fixes

  • Fixed a long-standing bug where hot pixels frequently appeared in blended images [before and after]

v0.3.0.0

3 years ago

See here for the full list of changes.

Known Bugs

  • The GUI can sometimes become unresponsive during morphing calculations (but eventually returns to normal)
    • QtCore.QCoreApplication.processEvents() is a potential workaround but currently produces buggy results

Added

  • Freestyle Point Placement
    • QoL: The user can now place point pairs on the images in whatever order they wish
    • Keyboard/mouse input logic has been rewritten to maintain previous behavior with Undo, Delete, OUT, etc.
  • Redo (CTRL+Y) Functionality
    • The user may now redo any point placement that was previously undone or deleted
      • Points are recovered in the order they were undone or deleted
      • The cache is cleared whenever a new point is placed by the user

Changes

  • Added logging that was previously missing from MorphingApp.py's Undo logic

Fixes

  • Fixed a bug where the alpha slider and auto-corner button were not enabling when new images were loaded
    • Comment: Just an oversight that spawned from the changes to the image loading methods in v0.2.9.0