o
    rfi                     @   s    d dl Z d dlmZ dd ZdS )    N)Imagec           
      C   s   t j|st | dd t | D }|  t|D ]1\}}t j| |}t	|}|
d}||tj}|d dd}t j||}	||	d qtd tt|D ]$}|d dd}t j||}	t	|	}t| d	|j d
|j  qYd S )Nc                 S   s   g | ]}|  d r|qS ))pngjpgjpeg)lowerendswith).0f r
   C/workspaces/Masterarbeit/13_resize_and_rename_images/output_4_0S.py
<listcomp>
   s    z,resize_and_rename_images.<locals>.<listcomp>RGB   03z.jpgJPEGzModified images resolutions:z: z x )ospathexistsmakedirslistdirsort	enumeratejoinr   openconvertresizeZ	ANTIALIASsaveprintrangelenwidthheight)
input_folderoutput_folder
resolutionimage_filesindexfilenameimg_pathimgnew_filenamenew_pathr
   r
   r   resize_and_rename_images   s&   



r,   )r   PILr   r,   r
   r
   r
   r   <module>   s    