function ctwp() {
      extension=$1 # take the extension you provided the function
      for i in *.$extension # iterate through the files in the directory based on the extension
      do
        file=$i # declare the file as an easy-to-read variable
        convert $file ${file%.*}.webp 
            # The above line:
            #a) executes the ImageMagick command, and 
            #b) removes the basename from the file to grab only the file name 
            #(so ‘bull.jpg’ becomes ‘bull’)
      done
}
