Filters the image sizes automatically generated when uploading an image.
Parameters
$new_sizesarray- Associative array of image sizes to be created.
$image_metaarray- The image meta data: width, height, file, sizes, etc.
$attachment_idint- The attachment post ID for the image.
Source
$new_sizes = apply_filters( 'intermediate_image_sizes_advanced', $new_sizes, $image_meta, $attachment_id );
You can exclude certain image types from images sizes, like gifs