o
    rfz                     @   s.   d dl Z d dlmZ dededefddZdS )    N)Imageinput_folderoutput_folder
resolutionc           
   
      s   t j|st | t fddt  D }g }t|ddD ]I\}}tt j	 |3}|
d}||}|dd}|t j	|| || d|d	  d
|d   W d    n1 sew   Y  q!td |D ]}	t|	 qqd S )Nc                    s&   g | ]}t jt j |r|qS  )ospathisfilejoin).0fr   r   D/workspaces/Masterarbeit/13_resize_and_rename_images/output_6_CoT.py
<listcomp>	   s   & z,resize_and_rename_images.<locals>.<listcomp>   )startRGB03z.jpgz: r   z x zModified images resolutions:)r   r   existsmakedirssortedlistdir	enumerater   openr
   convertresizesaveappendprint)
r   r   r   image_filesZmodified_imagesifilenameimgnew_filenameinfor   r   r   resize_and_rename_images   s"   


$
r%   )r   PILr   strtupler%   r   r   r   r   <module>   s    