trezen

Untitled

Jan 23rd, 2023 (edited)
912
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.62 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Ask the user to select an image file
  4. file_path=$(zenity --file-selection --title="Select an image")
  5.  
  6. # demande à l'utilisateur quel niveau de charbonage.
  7. echo "Choisir un niveau de charbonage (1-5):"
  8. read charbonage
  9.  
  10. # Convert the image to the chosen colorspace
  11. convert "$file_path" -charcoal "$charbonage" "temp.jpg"
  12.  
  13. # Show a preview of the converted image
  14. xdg-open "temp.jpg"
  15.  
  16. # Ask the user if they want to keep the converted image
  17. echo "Do you want to save this converted image? (yes/no)"
  18. read answer
  19. if [ "$answer" = "yes" ]; then
  20.     mv "temp.jpg" "$file_path"
  21. else
  22.     rm "temp.jpg"
  23. fi
  24.  
Advertisement
Add Comment
Please, Sign In to add comment