Forum Archive

Working with pictures

Kluesi

Hi

I want to add a greyscale image (a logo) to a picture. I wrote a little ios pythonista app in which I open a picture from an album and show it on the view in an ui.imageview. This works.

And the other magic is missing. I want to show the logo (I have the black logo on a white background as an jpg or png image) on the loaded picture. I want to change the size of the logo by using two fingers and I want to move the logo by using one finger. The last step is to combine both pictures and save the result in an album.

  1. How to show only the non white parts of the logo on my picture
  2. How to move it with one finger
  3. How to chsnge the size with two fingers

Many thanks

Kluesi

mikael

@Kluesi, is the logo always the same? Use an external app like Magic Eraser to turn the white to transparent pixels.

Gestures supports pinch for resizing and pan for moving.

enceladus

Here is a stack overflow answer and I have not tried it. https://stackoverflow.com/questions/765736/using-pil-to-make-all-white-pixels-transparent

enceladus

Moving a view and changing size based on segmentedcontrol selection https://gist.github.com/357b2aef8c09a15289c6193597035861