A Swift-based command-line tool that transforms initially non-uniform images into uniformly-sized ones through the application of spacing, centering, and scaling. This project utilizes the Core Graphics framework for image rendering and manipulation.
Note
This project is currently in the works, and updates are ongoing.
The following will generate an image of size 2000x1000 that will act as the container for the image t1.png
. The generated image is saved in the test-results
directory.
swift run EvenImage ./t1.png test-results/ --height 1000 --width 2000
The following are three generated images. The input images are placed on a gray background. The input image scales to fit the given size (in this case, 2000x1000).
Since Image 1 is wide, it will scale to fit the width of the 2000x1000 container while leaving space on the top and bottom. Since Image 2 is tall, it will scale to fit the height of the 2000x1000 container while leaving space to the left and right.