| 306 | * If number of unique colors is already 256 or less, |
| 307 | * Use an filesize optimizing filter that will retain the same number of colors when resizing. |
| 308 | * This will reduce occurrences of having a resized image filesize very much larger than the original. |
| 309 | * @since 4.6.0 |
| 310 | */ |
| 311 | |
| 312 | if ( is_callable( array( $this->image, 'getImageColors' ) ) ) { |
| 313 | $number_of_unique_colors = intval( $this->image->getImageColors() ); |
| 314 | if ( $number_of_unique_colors <= 256 ) { |
| 315 | $filter_name = 'FILTER_POINT'; |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | /** |