Python Image Morpher (PIM) is a program that can take two images and blend them to whatever extent or precision that you like

Overview


Python Image Morpher (PIM) is a program that can take two images and blend them to whatever extent or precision that you like! It is designed to emulate some of Python's OpenCV image processing from scratch without reference.


This project began in Spring 2019 (detailed in readme_general.pdf, readme_phase_1.pdf, and readme_phase_2.pdf), requiring the usage of delaunay triangulation, projective/affine transformation, application of projections through matrices, masking, and alpha blending - all of which are still maintained - in order to accomplish image morphing. Thus, this repository is more of a 'proof of concept' than it is the most efficient way of accomplishing the given task of image morphing.

So far, this program has only been tested on separate Windows environments; if it does not already, later releases are likely to support Mac and Linux.


Installation:

This program has dependencies that do not come packaged with Python 3. To install the required modules, enter the following command using the terminal supplied by Windows or your choice of IDE (such as PyCharm):

pip install -r requirements.txt

Alternatively, for each module below that your machine does not have installed, enter the respective command(s):

PyQt5 - pip install pyqt5

SciPy - pip install scipy

NumPy - pip install numpy

Imageio - pip install imageio

Pynput - pip install pynput

OpenCV - pip install opencv-python

BeautifulSoup - pip install beautifulsoup4

If pip, for whatever reason, is not installed on your machine, enter the following line in a terminal:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

Followed by this line afterwards:

python get-pip.py

Usage:

  • Run MorphingApp.py either through the terminal or using an IDE
  • Use the graphical interface to select the two images you want to morph together
  • Alternate clicking on related points of interest in your images to create correspondences
  • When satisfied, click the blend button to observe the result!

A more detailed Help guide is included within PIM's GUI, if needed.


Proof of Concept - Perspective Shifting

Development 'To-Do' List:

Although I feel that PIM is now feature complete as a project, I will continue to support it with updates as they come to me. This potentially includes, but does not guarantee:

  • Feature: Automatic Correspondence Determination
    • PIM may automatically generate points by scanning for similar features between images
  • Feature: Automatic Update Installation
  • Feature: Configuration Tab in GUI
    • The user can set/reset default parameters for PIMs GUI to use on initialization
  • Enhancement: Undo/Redo Compatibility with Move/Delete Mouse Modes

If you encounter an error, a bug, or if you simply wish to request a change/feature, please file an issue using the tracker that GitHub provides, here.

If you like what you see, feel free to contact me on LinkedIn or check out my website (WIP as time allows).

Comments
  • ask for advice

    ask for advice

    Hello, What an interesting show! I tried with photos of cats and dogs, and the results are as follows: result

    It seems that the effect is not ideal. Do you have any suggestions? Thanks

    opened by zcdliuwei 11
  • Save x,y coordinates of the landmarks

    Save x,y coordinates of the landmarks

    Hi, first of all, it's an amazing project of yours. I was reading your documentation and you write there that the user should be also able to upload the (x,y) coordinates of the landmark points. I have not found the option in your GUI. Is it already implemented? And more importantly, would it be possible to add a button for exporting the points into a txt file? Thanks a lot.

    opened by jankaWIS 8
  • Feature request: move points with mouse drag

    Feature request: move points with mouse drag

    The GUI is great and I still can't stop admiring it. I was wondering -- would it be possible to add a functionality that a point can be selected after it's placed and then with a drag moved to another location? Because now if one makes a mistake or is not precise enough, the only fix is to delete the point and then place it again which is a bit annoying. And even more if one realises that this mistake has been done a few moves back :).

    And especially with the automatic feature recognition mentioned in https://github.com/ddowd97/Python-Image-Morpher/issues/2, that would be a killer ;). I have some code related to automatic face landmark detection which I can share, it's not working great by itself but if the user could then tweak the not fitting parts, it would save the user a lot of time.

    enhancement 
    opened by jankaWIS 6
  • Enhancement: subpixel processing

    Enhancement: subpixel processing

    Hi David,

    Many thanks for your great image morphing application!

    I created this Python command line program based on your work:

    https://github.com/jankovicsandras/autoimagemorph

    The main difference (beside no GUI) is that autoimagemorph selects the points automatically, using cv2.goodFeaturesToTrack() .

    I noticed some image artifacts (bright pixels probably at Delaunay triangle edges) and found a simple method to remove them: upscale the image (for example 4x width and height), do the processing, downscale it to original size again. I call this subpixel processing in autoimagemorph , and the obvious downside is much more time and memory required (approx. 16x slower using -subpixel 4) . Still, it might be a good idea to provide this function optionally for better quality, as it's very easy to implement.

    Keep up the good work! :)

    opened by jankovicsandras 5
  • PyQT errors

    PyQT errors

    You must change opencv-python for opencv-python-headless in requirements.txt, as when executing the software it crashes as it uses opencv plugins instead of native PyQT ones.

    opened by dberga 2
  • Saving a blend as an image sequence

    Saving a blend as an image sequence

    The .gif exported has (sometimes) compression artifacts. How can a blend created in the Python Image Morpher be exported as an image sequence? Converting the .gif to an image sequence does not help as the compression artifacts still remain. Thank You!

    opened by NoJustAnother 2
  • Save images

    Save images

    I've been looking a bit at the code now, and I don't seem to be able to figure out how I could output the final image as an image file. It would be cool to be able to output all the different frames from a full blend into a gif for example. I don't know if you could point me in a direction where I could figure it out self, or if it maybe could be easy to implement for you, but I would really apreciate it

    opened by tokejuhoklee 2
  • Positive Feedback and Suggestions

    Positive Feedback and Suggestions

    Great work! Works perfectly in the Linux-container on my Chromebook.

    Suggestions

    • graphical mode indicator/selector [add][move][del]
    • "Interim Steps" 10 -- 1000 instead blend 0.1 -- 0.001

    Keep up the good work.

    my result: https://www.instagram.com/tv/CfAH-pmDOjj/?igshid=YmMyMTA2M2Y=

    opened by Jappie 2
Releases(v2.0.2)
  • v2.0.2(Dec 29, 2021)

    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
    Source code(tar.gz)
    Source code(zip)
    Morphing.Windows.v2.0.2.zip(49.44 KB)
  • v2.0.1(Aug 15, 2021)

    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
    Source code(tar.gz)
    Source code(zip)
    Morphing.Windows.v2.0.1.zip(48.88 KB)
  • v2.0.0(Jul 28, 2021)

    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.
    Source code(tar.gz)
    Source code(zip)
    Morphing.Windows.v2.0.0.zip(48.76 KB)
  • v2.0-beta(Jun 14, 2021)

    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.
    Source code(tar.gz)
    Source code(zip)
    Morphing.Windows.v2.0.BETA.zip(38.45 KB)
  • v1.1.2(May 2, 2021)

  • v1.1.1(Apr 30, 2021)

  • v1.1.0(Jan 17, 2021)

    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
    Source code(tar.gz)
    Source code(zip)
    Morphing.Windows.v1.1.0.zip(34.01 KB)
  • v1.0.0(Dec 13, 2020)

    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
    Source code(tar.gz)
    Source code(zip)
    Morphing.Windows.v1.0.0.zip(29.49 KB)
  • v0.3.0.1(Dec 2, 2020)

  • v0.3.0.0(Nov 21, 2020)

    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
    Source code(tar.gz)
    Source code(zip)
    Morphing.Windows.v0.3.0.0.zip(30.02 KB)
  • v0.2.9.0(Sep 5, 2020)

    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

    • Source Image Resizing
      • Since PIM requires the user's images to be the same size, it can now create and hotswap resized copies of the left/right images at the click of a button
      • For simplicity, one button resizes the left image to the right image's dimensions and the other button does the opposite
        • Both images must be loaded to enable this functionality
        • Additionally scales any added/confirmed/chosen points to the new image dimensions
        • Buttons will be set to bold whenever the user's images aren't the same size
      • Resized image files are stored under: ROOT_DIR/Images_Points/filename-[width]x[height].filetype
      • Resized text files are stored under: ROOT_DIR/Images_Points/filename-[width]x[height]-filetype.txt

    Changes

    • The program now locks out usage of point placement as well as the Add Corners button when the user's images aren't the same size
    • Text files are now stored under: ROOT_DIR/Images_Points/filename-filetype.txt
    Source code(tar.gz)
    Source code(zip)
    Morphing.Windows.v0.2.9.0.zip(29.80 KB)
  • v0.2.8.2(Aug 27, 2020)

    Changes

    • resizeEvent() has received a performance boost
    • Memory Optimization: Removed all instances of the variables used to:
      • Flag when the GUI was being resized: self.resizeFlag
      • Flag when left/right images were loaded: self.leftOn, self.rightOn
      • Flag whether left/right images were PNGs: self.leftPNG, self.rightPNG, leftTypeRegex, rightTypeRegex
      • Flag whether the smoothing box was checked: self.smoothBoxSetting
      • Flag whether the transparency box was checked: self.transparencySetting
      • Flag whether the full blend box was checked: self.blendBoxSetting
      • Flag whether the user has performed a morph in the current session: self.blendExecuted
      • Store triangle color slider values: self.redVal, self.blueVal, self.greenVal
      • Store an additional copy (!!!) of each image's chosen points: self.startingText, self.endingText

    Fixes

    • Fixed a long-standing bug where .jpg blends could sometimes appear in the GUI to be wildly distorted and - occasionally - grayscale
    • autoCorner() now checks that neither image contains each corner point before adding it
    Source code(tar.gz)
    Source code(zip)
    Morphing.Windows.v0.2.8.2.zip(28.33 KB)
  • v0.2.8.1(Aug 25, 2020)

  • v0.2.8.0(Aug 24, 2020)

    Added

    • Morphed Image Saving
      • Normal blends can now be saved as their respective image types; full blends can now be saved as dynamic GIFs
        • Generated GIFs are subject to the user's preference for the amount of time (default: 100 ms) given to each frame

    Changes

    • To accommodate this update, the following elements in MorphingGUI.ui and MorphingGUI.py have been changed:
      • Added a "Save Image(s)" button alongside a smaller frame time textbox
        • A fairly air-tight Qt mask is used to restrict letter and symbol input - format is "[0-9][0-9][0-9] ms"
        • The program handles other invalid inputs (000, no input)
      • Minimum size of the main window has changed from (878 x 797) to (878 x 850)
    Source code(tar.gz)
    Source code(zip)
    Morphing.Windows.v0.2.8.0.zip(27.98 KB)
  • v0.2.7.0(Aug 23, 2020)

    Added

    • Morphed Image Smoothing
      • A toggleable median filter is now applied to every blend and full blend
        • This filter attempts to remove hot pixels in morphed images by utilizing neighboring pixel values instead
        • Very little to no impact on program performance

    Changes

    • The GUI now displays the current image frame being generated when full blending is enabled
    • Removed two sub-module imports (Qt's QGraphicsScene & QGraphicsView) that were no longer in use

    Fixes

    • Corrected an instance where the notification bar stated that the program was blending was in RGB mode instead of RGBA
    Source code(tar.gz)
    Source code(zip)
    Morphing.Windows.v0.2.7.0.zip(26.47 KB)
  • v0.2.6.1(Jul 28, 2020)

    Changes

    • Optimizations to Morphing.py's loadTriangles() and getPoints() functions
      • Declarations, re-assignments, loops, and return statements have been streamlined to be more efficient
    • Optimized MorphingApp.py's blendImages() function to no longer have to [repeatedly] deepcopy each array slice
      • Initialization of a Morpher object will now deepcopy the passed arguments to its left and right image variables
    • Removed more unnecessary module dependencies

    Fixes

    • Fixed a bug where .png (RGBA) images could only be morphed into .jpg images (RGB)
    Source code(tar.gz)
    Source code(zip)
    Morphing.Windows.v0.2.6.1.zip(25.96 KB)
  • v0.2.6.0(Jul 23, 2020)

    Python Image Morpher is a program that can take two images and blend them to whatever extent or precision that you like! So far, it has only been tested on separate Windows environments; later releases are likely to support Mac and Linux.

    Installation:

    This program has dependencies that do not come packaged with Python 3.8. For each module below that your machine does not have installed, enter the respective command using the terminal supplied by Windows or your choice of IDE (such as PyCharm).

    PyQt5 - pip install pyqt5 SciPy - pip install scipy NumPy - pip install numpy Matplotlib - pip install matplotlib

    If pip, for whatever reason, is not installed on your machine, enter the following line in a terminal:

    curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
    

    Then navigate to the folder where get-pip.py was downloaded and enter the following line in a terminal:

    python get-pip.py
    

    Usage:

    • Run MorphingApp.py either through the terminal or using an IDE
    • Use the graphical interface to select your two images to morph
    • Click on points of interest in your images to create correspondences
    • When satisfied, click on blend and observe the result!
    Source code(tar.gz)
    Source code(zip)
    Morphing.Windows.v1.0.0.zip(26.65 KB)
Owner
David Dowd
Purdue 2020 Graduate in Computer Engineering; Programmer; Nerd
David Dowd
Python-based tools for document analysis and OCR

ocropy OCRopus is a collection of document analysis programs, not a turn-key OCR system. In order to apply it to your documents, you may need to do so

OCRopus 3.2k Jan 04, 2023
Short piece of code to create a rainbow gif of gradual contours from two shapefiles

rainbow-elevation-gif Short piece of code to create a rainbow gif of gradual con

Jess Roberts 6 Jan 17, 2022
Automatic picture transmission(APT) protocol decoder for NOAA weather satellites

Automatic picture transmission(APT) decoder Automatic picture transmission protocol is used by NOAA satellites. They constantly send a frequency modul

Jayachandra Kasarla 25 Aug 05, 2022
Small wrapper around 3dmol.js and html2canvas for creating self-contained HTML files that display a 3D molecular representation.

Description Small wrapper around 3dmol.js and html2canvas for creating self-contained HTML files that display a 3D molecular representation. Double cl

David Meijer 1 Dec 02, 2021
Change the image one color channel at a time.

Building-a-Contact-Sheet This hands-on Project is in Python 3 Programming Specialization offered by University of Michigan via Coursera. change the im

Eszter Pai 1 Jan 03, 2022
A simple programming language for manipulating images.

f-stop A simple programming language for manipulating images. Examples OPEN "image.png" AS image RESIZE image (300, 300) SAVE image "out.jpg" CLOSE im

F-Stop 6 Oct 27, 2022
Dynamic image server for web and print

Quru Image Server - dynamic imaging for web and print QIS is a high performance web server for creating and delivering dynamic images. It is ideal for

Quru 84 Jan 03, 2023
A python based library to help you create unique generative images based on Rarity for your next NFT Project

Generative-NFT Generate Unique Images based on Rarity A python based library to help you create unique generative images based on Rarity for your next

Kartikay Bhutani 8 Sep 21, 2022
Design custom QR codes with this web app!

My-QR.Art This web app lets users design their own QR codes to any domain. It can be acessed on my-qr.art. You can find some more background info abou

Marien Raat 406 Dec 20, 2022
Computational Xmas Tree lights!

Computational Xmas Tree This repo contains the code for the computational illumination of a Christmas Tree! It is based on the work by Matt Parker fro

GSD6338 146 Dec 23, 2022
Pyconvert is a python script that you can use to convert image files to another image format! (eg. PNG to ICO)

Pyconvert is a python script that you can use to convert image files to another image format! (eg. PNG to ICO)

1 Jan 16, 2022
Easy to use Python module to extract Exif metadata from digital image files.

Easy to use Python module to extract Exif metadata from digital image files.

ianaré sévi 719 Jan 05, 2023
SALaD (Semi-Automatic Landslide Detection) is a landslide mapping system

SALaD (Semi-Automatic Landslide Detection) is a landslide mapping system. SALaD utilizes Object-based Image Analysis and Random Forest to map landslides.

NASA 14 Jan 04, 2023
Napari 3D Ortho Viewer - an ortho viewer for napari for 3D images

napari-3d-ortho-viewer Napari 3D Ortho Viewer - an ortho viewer for napari for 3D images This napari plugin was generated with Cookiecutter using @nap

niklas netter 5 Nov 28, 2022
CropImage is a simple toolkit for image cropping, detecting and cropping main body from pictures.

CropImage is a simple toolkit for image cropping, detecting and cropping main body from pictures. Support face and saliency detection.

Haofan Wang 15 Dec 22, 2022
This is an app that allows users to upload photos and display and store the photos in a file until the user deletes them.

Qt Photo App This is an app that allows users to upload photos and display and store the photos in a file until the user deletes them. Setup python3 -

Kathy Yang 5 Jan 22, 2022
An API that renders HTML/CSS content to PNG using Chromium

html_png An API that renders HTML/CSS content to PNG using Chromium Disclaimer I am not responsible if you happen to make your own instance of this AP

10 Aug 08, 2022
3D Model files and source code for rotating turntable. Raspberry Pi, DC servo and PWM modulator required.

3DSimpleTurntable 3D Model files and source code for rotating turntable. Raspberry Pi, DC servo and PWM modulator required. Preview Construction Print

Thomas Boyle 1 Feb 13, 2022
PyLibTiff - a wrapper to the libtiff library to Python using ctypes

PyLibTiff is a package that provides: a wrapper to the libtiff library to Python using ctypes. a pure Python module for reading and writing TIFF and L

Pearu Peterson 105 Dec 21, 2022
An automated Comic Book downloader (cbr/cbz) for use with SABnzbd, NZBGet and torrents

Mylar Note that feature development has stopped as we have moved to Mylar3. EOL for this project is the end of 2020 and will no longer be supported. T

979 Dec 13, 2022