python image unified transform - python

I looking for a way to transform a Image into a another one.
The tool from GIMP work perfectly for my task: "Unified Transform Tool"
But is there a way to do it with a python lib? Like openCV or PIL?
My Goal is it to add images to mockup photos and I have to do it automaticly.

I don't know the GIMP technique, but it looks like a "Scale Rotate Translate" kind of thing which you can do in Python with wand.
You can do the same thing in the Terminal with ImageMagick. Tutorial and examples here.

Related

How can I make a bayer image and become a debayer again? (demosaicing)

My goal is to blur the picture a bit using a bilinear debayer.
This is to embody the dirty image of the VHS days.
As a graphic major, I tried to reproduce it with various graphic tools, but did not get the desired quality result.
I want that subtle feeling of faded haze when scanned with a scanner.
I decided to emulate a camera sensor.
The process I envisioned is this:
I convert the tiff,targa.png.jpg format image I made into a bayer format image. I want to restore the original image by debayering it again with a bilinear algorithm.
The reason for the bilinear method is that it degrades most gently and strongly.
The link below is the image change according to the algorithm.
https://www.dpreview.com/forums/post/63514167
I'm not a programmer at all, but I've tried something on my own to get what I want.
https://codegolf.stackexchange.com/questions/86410/reverse-bayer-filter-of-an-image
I succeeded in making an image of the Bayer pattern using the coding here.
And I tried debayering by running the debayer source code downloaded from other places, but it failed because the extension was not supported.
So you can change demoasic(debayer) in various ways
I got a program called darkable and raw therapy and tried to convert it, but these programs could only recognize raw files.
Even the algorithms provided by both programs were so good that it was hard to get the impression that the image was degraded.
How do I make what I want?
What can I look for? I really want to make this.
Please let me know which way I should go.

"imagio.imsave" vs "imageio.core.util.Array.tofile"

I am expanding my limited Python knowledge by converting some MATLAB image analysis code to Python. I am following Image manipulation and processing using Numpy and Scipy. The code in Section 2.6.1 saves an image using both imageio.imsave and face.tofile, where type(face)=<class 'imageio.core.util.Array>'.
I am trying to understand why there are two ways to export an image. I tried web-searching tofile, but got numpy.ndarray.tofile. It's very sparse, and doesn't seem to be specific to images. I also looked for imageio.core.util.Array.tofile, but wasn't able to find anything.
Why are there two ways to export files? And why does imageio.core.util.Array.tofile seem to be un-findable online?
The difference is in what the two functions write in the file.
imageio.imsave() saves a conventional image, like a picture or photo, in JPEG/PNG format that can be viewed with an image viewer like GIMP, feh, eog, Photoshop or MSxPaint.
tofile() saves in a Numpy-compatible format that only Numpy (and a small number of other Python tools) use.

Recommendations for backend image processing in Python

On my site I'm using simple text overlay. Inputs come from textboxes and then javascript makes an AJAX call with the inputs that are then processed in the backend by PIL (Python Imaging Library).
Thing is, I'm not happy about the quality of PIL's text overlays - it's not possible to do a nice looking stroke (e.g. white font color + black stroke) and I'm thinking about switching to a different solution than PIL. I want to stay with Python though.
What would you recommend for image processing in Python? Which library offers the best quality?
Thanks!
Best,
Tom
If all you want to do is overlay text, I suggest you simply use imagemagick.

Python - Identifying/Processing an Image

I'm looking in to learning about processing and handling images with Python. I'm experimenting with searching the inside of an image for a specific picture. For example, this picture has two images in it that are the same;
In Python, how would I go about detecting which two images are the same?
I would recommend you to take a look at OpenCV and PIL, if you want to implement simple (or complex) algorithms on your own.
Furthermore you can integrate OpenCV with PIL and also numpy, which makes it a really powerful tool for this kind of jobs.

Imagemagick or similar for scripted image enhancement

I found the following algorithm to work fairly well for enhancement of various images of whiteboards, etc:
duplicate the layer, make sure the top layer is active
(gaussian)blur the new layer. You shouldn't be able to read the text anymore.
set the layer mode to dodge
invert the layer
I tried it out in gimp and it looks promising. I'd like to try it en-masse for a large number of images and make it available as a command line tool.
I realize I can script gimp, but that feels too heavy for this purpose. Imagemagick seems ideal for this, but I don't know if I can do the layering with it.
So the question is:
Is there a way to script imagemagick to do the above algorithm without the use of a temporary file?
Is there a reasonable alternative library/tool that can be integrated with Python?
There is a ImageMagick script for whiteboard cleanup here - http://www.fmwconcepts.com/imagemagick/whiteboard/index.php

Categories

Resources