Hello guys! I really need help! How can I load images and save them, having previously processed using these functions? As a result, I need to get randomly processed images (shift, rotation). Ps: I apologize if the question is not correct

- 2If the code is important, it must be text. But in general, something is too much for him to be important. minimal reproducible example . - Qwertiy β¦
- @Qwertiy, found on the github open spaces here If you can help, I will be grateful. Itself, unfortunately, could not cope - Ivan Ilichev
- I can not help, I do not understand these technologies. - Qwertiy β¦
- 2It is better to insert any text into a question as text β pictures tend to be removed from hosting sites, appear poorly on mobile phones, text cannot be selected and copied, also search by pictures does not work and people with a similar problem cannot find a question. To work with images, you can take Pillow - there is both a turn, and a shift, and all this using different methods, and even a sea of ββeverything for pictures. - m9_psy
- one@IvanIlichev, what are your problems? Your link seems to be quite understandable examples ... - MaxU
|
1 answer
Privetstvuyu. I advise you to use the PIL module, which allows you to load photos as a two-dimensional array and, subsequently, save them with appropriate methods:
from PIL import Image # ΠΠΎΠ΄ΠΊΠ»ΡΡΠΈΠΌ Π½Π΅ΠΎΠ±Ρ
ΠΎΠ΄ΠΈΠΌΡΠ΅ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠΈ. image = Image.open("example.jpg") # ΠΡΠΊΡΡΠ²Π°Π΅ΠΌ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠ΅. image.save("result.jpg", "JPEG") # Π‘ΠΎΡ
ΡΠ°Π½ΡΠ΅ΠΌ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠ΅, ΠΏΠΎΡΠ»Π΅ Π΄Π΅ΠΉΡΡΠ²ΠΈΠΉ Ρ Π½ΠΈΠΌ. |