o
    rf                     @   s    d dl Z d dlmZ dd ZdS )    N)Imagec              	   C   s4  t j|st | dd t | D }|  t|D ]:\}}tt j	| |$}|
d}||}|d dd}	|t j	||	 W d    n1 sRw   Y  qtd t|D ]7\}}|d dd}	tt j	||	}|j\}
}t|	 d|
 d	|  W d    n1 sw   Y  q`d S )
Nc                 S   s   g | ]}|  d r|qS ))pngjpgjpegbmpgif)lowerendswith).0f r   D/workspaces/Masterarbeit/13_resize_and_rename_images/output_7_CoT.py
<listcomp>   s    z,resize_and_rename_images.<locals>.<listcomp>RGB   03z.jpgzModified images resolutions:z: z x )ospathexistsmakedirslistdirsort	enumerater   openjoinconvertresizesaveprintsize)input_folderoutput_folder
resolutionimage_filesidxZ
image_fileimgZrgb_imgZresized_imgnew_filenamewidthheightr   r   r   resize_and_rename_images   s*   



r)   )r   PILr   r)   r   r   r   r   <module>   s    