### ImageMagick version

7.1.1-10

### Operating system

Windows

### Operating system, version and so on

10.0.19045.2965 x64

### Description

I composed an image containing alpha transparency and stored it as a PNG file. It happened to have not more than 256 colors so IM chose to store it in a palette format. When I converted the PNG file to the ICO file, I first noticed that something was odd about how it looked like, then I realized that IM silently converted the alpha transparency of the source image to 1-bit transparency. If the PNG file happens to have more than 256 colors (so IM cannot store it in palette format) or if I force IM to store it as a PNG32, the resulting ICO is 32-bit colors as expected. IM 7.1.0-2 created an ICO with alpha transparency, i. e. 32-bit colors, in all cases.

So I find it very odd that IM's decision about the output format is based on whether the input uses a palette or not. I find it evenly odd that IM's decision is not influenced by the fact that the image contains alpha transparency, which it will have to discard, or by how many colors are _actually_ used.

I would like to mention that it is not a good idea to change the color mode of an image at all if it is supposed to be stored as an icon. An icon is not just a simple collection of images. Each individual image has its own meaning. A 32-bit image serves a different purpose than a palette-based image _even_ if their ARGB values happen to be identical bit by bit.

### Steps to Reproduce

Create an image with alpha transparency and not more than 256 colors:
`magick -size 100x100 xc:transparent rose: -composite -resize 10x10 test.png`
Note that the result of this command is already different in 7.1.1-10 and 7.1.0-2 because the resize operation has been modified, as it seems. So if you want to see the exact difference, you need to create the file with one version and use it in both.
Then convert it to an icon:
`magick test.png test.ico`
You will notice that all alpha transparency is unexpectedly gone.

### Images

_No response_
Alpha transparency is converted to 1-bit transparency in ICO file
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : Alpha transparency is converted to 1-bit transparency in ICO file
Issue date:

--- start body ---
### ImageMagick version

7.1.1-10

### Operating system

Windows

### Operating system, version and so on

10.0.19045.2965 x64

### Description

I composed an image containing alpha transparency and stored it as a PNG file. It happened to have not more than 256 colors so IM chose to store it in a palette format. When I converted the PNG file to the ICO file, I first noticed that something was odd about how it looked like, then I realized that IM silently converted the alpha transparency of the source image to 1-bit transparency. If the PNG file happens to have more than 256 colors (so IM cannot store it in palette format) or if I force IM to store it as a PNG32, the resulting ICO is 32-bit colors as expected. IM 7.1.0-2 created an ICO with alpha transparency, i. e. 32-bit colors, in all cases.

So I find it very odd that IM's decision about the output format is based on whether the input uses a palette or not. I find it evenly odd that IM's decision is not influenced by the fact that the image contains alpha transparency, which it will have to discard, or by how many colors are _actually_ used.

I would like to mention that it is not a good idea to change the color mode of an image at all if it is supposed to be stored as an icon. An icon is not just a simple collection of images. Each individual image has its own meaning. A 32-bit image serves a different purpose than a palette-based image _even_ if their ARGB values happen to be identical bit by bit.

### Steps to Reproduce

Create an image with alpha transparency and not more than 256 colors:
`magick -size 100x100 xc:transparent rose: -composite -resize 10x10 test.png`
Note that the result of this command is already different in 7.1.1-10 and 7.1.0-2 because the resize operation has been modified, as it seems. So if you want to see the exact difference, you need to create the file with one version and use it in both.
Then convert it to an icon:
`magick test.png test.ico`
You will notice that all alpha transparency is unexpectedly gone.

### Images

_No response_
--- end body ---
