A Simple app written with C++ and QT6, with straighforward UI, Just Drag & Drop your image and choose your desired tranformation.
Supported Transformtions:
- Black & White Transformer
- Image Invert
- GrayScale Transformer
Supported File Formats:
- PNG
- JPEG
- BMP
demo1_compressed.mp4
- Download "Windows.7z" from the Releases Sections.
- Decompress it.
- Run "QTransform.exe"
- Drag and Drop your image and you are good to go.
- Prequisties: QT6, CMake, MinGW-64.
- Download QT6: https://www.qt.io/download-dev
- CMake: https://cmake.org/download/
- MinGW-64: https://github.com/skeeto/w64devkit
After downloading all the requirements, open powershell and run
git clone --depth=1 https://github.com/JustForCollege/QTransform.git
cd QTransform
mkdir build
cd build
cmake .. -G"MinGW Makefiles" -DCMAKE_PREFIX_PATH="C:\Qt\<version>\mingw_64\lib\cmake" -DQT_DIR="C:\Qt\<version>\mingw_64\lib\cmake\Qt6"
I simply go through the image pixels, then apply a gray scale transformation on each pixel, then checking to see if the resulting gray value is larger than or equal a specific threshold (I picked 127), I then set that pixel to white, else set it to black. it can be described as follows:
Load(Image)
For pixel in Image.Pixels:
grayedPixel = GrayScale(pixel)
if grayedPixel >= 127:
pixel = WHITE
else:
pixel = BLACK
Save(Image)
I have used QT6 QImage::convertToFormat(QImage::Format_Grayscale8)
function to do a GrayScale Transformation however the algorithm is quite simple
and it can be described as follows:
Load(Image)
For pixel in Image.Pixels:
grayedPixel = (pixel.red + pixel.green + pixel.blue) / 3
pixel = grayedPixel
Save(Image)
I have used QT6 QImage::invertPixels()
function to invert the image, however the algorithm for inverting an image is quite simple and it can be described as follows
Load(Image)
For pixel in Image.Pixels:
pixel.red = 255 - pixel.red
pixel.green = 255 - pixel.green
pixel.blue = 255 - pixel.blue
Save(Image)