anon
anon

Reputation:

Extracting a .PNG from .EXE?

I have always thought how to extract an image from the icon of a .exe window file. Is there an easy way to do it maybe with GD?

I think the step would be:

Upvotes: 2

Views: 2584

Answers (1)

Vilx-
Vilx-

Reputation: 106980

An icon is a fairly complex beast. Converting to a PNG will not be easy, because:

  • There can be several icons inside a single .exe;
  • There can be several images inside a single icon, with different sizes and color depths;
  • The images can be compressed in several ways;
  • The images have bitmasks (making such effects as inverting background colors possible), which have no equivalent in PNG.

As far as I'm aware GD does not support icon format. Imagemagick seems to, maybe you can use that. Otherwise you might need to write your own icon extractor.

Upvotes: 3

Related Questions