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 snippet snippet

  • 2
    If 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 ♦
  • 2
    It 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 1

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") # БохраняСм ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅, послС дСйствий с Π½ΠΈΠΌ.