1

Topic: What's yet to come in Image Analyzer?

Are there any other features you plan to add to this program? Or are you done with working on the software?

2

Re: What's yet to come in Image Analyzer?

There will probably be a new version when I find some interesting feature to add... Right now I am quite busy with other projects.

Michael Vinther

> software developer <

3 (edited by Ben321 2009-07-29 23:20:14)

Re: What's yet to come in Image Analyzer?

I just realized something important that should be added to image analyzer. Currently, when converting from a 24bit RGB color picture to an 8bit 256 color picture, it generates a 256 color palette, even if the total number of unique colors is less than 256. This poses a problem when trying to save the now-256-color picture which actually contains less than 256 colors as a bitmap file while attempting to reduce file size by keeping the smallest possible palette size in the file. The remaining palette entries are just filled with zeros (I know, I checked with a hex editor). While in some cases a full 256 color pallet padded with zeros may be desirable, in most cases (at least from my point of view), a palette containing ONLY the colors used in the picture is the best type of palette, and it can significantly reduce the file size, especially if the picture is physically small like less than 50x50 pixels, as then the palette takes a reasonable fraction of the file size.

I already tried the "optimize palette" option. But it doesn't truly remove unused palette entries, it just sets them all to zero.


With this said, I believe an option should exist when converting a 24-bitPP picture to an 8-bitPP picture, if less than 256 unique colors are present. In that case it could pop up an option box when you click the convert menu item to perform the conversion. conversion, asking whether to use the smallest possible palette, or use a 256 entry palette while padding the remainder with zeros.

Of course if >256 it should also pop up an option box, but it should ask then which method should be used for color reduction and dithering (just like Photoshop has). I see you already have one letting me pic which algorithm to use, but Photoshop lets set more specifics of the algorithm such as what percent dithering to use, with 0% being "nearest color" which can sometimes be obvious that the picture is missing colors, all the way up to 100% which makes it look more grainy but it visually "simulates" far more than 256 colors.

Only if there are EXACTLY 256 colors should it proceed without asking for user input.

And there is one other conditino it shouldn't ask. If there is (and I'm not sure if there is) a way to batch convert all open pictures, then it should only ask once at the beginning what it should do for <256 colors and once for >256 colors and then use those settings for the all of that batch conversion session.

4

Re: What's yet to come in Image Analyzer?

If you save as PNG also the palette will be compressed

Michael Vinther

> software developer <

5 (edited by Ben321 2009-07-31 1:41:45)

Re: What's yet to come in Image Analyzer?

I'm looking specifically for REMOVING unsused palette entries so when saving a file as a BMP file it saves no more palette entries than needed. For example, in Image Analyzer a palette using 100 colors is actually 256 palette entries long, it just has 100 colors used, but the remaining 156 colors are set to black, and ARE saved into a bitmap file when saving as BMP. This is a waste of space in a BMP file. If I'm only using 100 colors in my picture file, the palette should only be 100 palette entries long, so when saved the bitmap file color palette will ONLY contain 100 entries. That is what I mean. Now Photoshop does this, but sadly Image Analyzer does not.

But just because Image Analyzer currently isn't set up to do this, doesn't mean that Image Analyzer can't do it. All you have to do is add this functionality to it. You are the programmer after all.

Let me explain exactly what I'm looking for, and why I need it.

I have a picture I'm looking to insert into a game (I'm into computer game modding), and it expects a color palette containing EXACTLY 216 entries (NOT 216 colors used and the remainder left black). Now I have a picture containing 18 colors and saved as a 24bit bitmap file. Now if I convert it to an 8 bit file in Image Analyzer it will make a palette containing 256 colors, of which, only 18 are used and the rest are black. This is not acceptable as the game crashes when it detects the wrong number of palette entries in the file. I need a way to MANUALLY set how many colors are in it, so I can manually set the number of palette entries in the BMP file to any number I choose (216 in this case). If a picture has more than that many colors Image Analyzer should approximate 216 colors to best match the colors in the picture. If I start with a picture containing less than 216 colors, Image Analyzer should add black filled palette entries to make the total be 216 colors. But 216 just is for one of the pictures in the game. Some of the pictures the game loads use 192 colors, or even all 256 colors. So I need the EXACT number of palette entries to be user settable to any value between 2 and 256, so that when I save an 8 bit bitmap file from Image Analyzer, it will contain EXACTLY the number of color palette entries that I specify.

Why not just use Photoshop (after all, I have it)? Well I'm looking to make an online tutorial on a gaming website explaining how anybody, even someone who's on a "limited budget", can edit this game using free software (Photoshop costs a ton of money if you get it legally, and I DON'T plan to encourage software piracy in my tutorial). So for this tutorial I need FREE software that can do what I just described in my previous paragraph here. That's where your program Image Analyzer comes in. Unfortunately it can't do what I've just described, so I am requesting that you add that functionality to it.

6

Re: What's yet to come in Image Analyzer?

OK, I see your point but it is not something I have any use for so it is not likely that I will spend time on it. Sorry.

Michael Vinther

> software developer <

7

Re: What's yet to come in Image Analyzer?

admin wrote:

OK, I see your point but it is not something I have any use for so it is not likely that I will spend time on it. Sorry.

Why wouldn't you find it useful? Even for something not for a specific application, it can still save harddrive space by reducing the file size of BMP files. This is especially important for files that have small picture sizes, as the image data is actually small compared to the palette entries.

You see, in an 8-bit BMP file, a palette entry takes 4 bytes:
B=Blue
G=Green
R=Red
X=Unused

So 256 palette entries takes 256*4=1024 bytes. But each pixel of image data only takes 1 byte. So 1024 bytes is the same size as a 32x32 picture's image data. If you only are using for example, 20 colors, then you don't need to waste 944 bytes on unused palette entries in your bitmap file. In Photoshop for example when converting to an 8-bit image, you can mark unused palette entries as actually unused, not just the color black. This way, when saving the image as a file that stores the color palette (such as a BMP file), it doesn't waste file space.

8

Re: What's yet to come in Image Analyzer?

If I want to save hard disk space, I use PNG smile

Michael Vinther

> software developer <

9

Re: What's yet to come in Image Analyzer?

admin wrote:

If I want to save hard disk space, I use PNG smile

Ok. But what if you needed an 8bit BMP file for some reason (such as another program was expecting it as input), but wanted to save space by removing any unused color palette entries? Wouldn't you then find such a feature useful? Or what if a particular program was expecting a BMP file with an EXACT specific number of palette entries, wouldn't you then find such a feature useful?

10

Re: What's yet to come in Image Analyzer?

Yes, I would, but I don't have such a need...

Michael Vinther

> software developer <

11 (edited by Ben321 2009-08-15 7:09:22)

Re: What's yet to come in Image Analyzer?

Well if you primarily use it for yourself (to the point you won't implement a feature someone else suggests if it won't directly help you) then why do you even have the program available to the public as downloadable?

12

Re: What's yet to come in Image Analyzer?

Good point. I also ask myself that question sometimes...
Actually I do get a lot of suggestions for features that I find interesting or that I could also use myself but just haven't thought of. Also, I sometimes make a little money on implementing features that people want to pay for.

Michael Vinther

> software developer <

13

Re: What's yet to come in Image Analyzer?

Is there any possibility for Warp Sharp feature to appear in IA? Currently I don't think even Photoshop has it (at least I found nothing googling for "8bf warpsharp"), therefore to use it I have to open image in VirtuaDub, which is not convenient for image editing, of course. I just thought that since IA has various kinds of Blur, maybe it will be nice to add another kind of Sharpen as well.

14

Re: What's yet to come in Image Analyzer?

I have absolutely no idea what Warp Sharp is  smile  Can you explain or do you have some reference explaining it?

Michael Vinther

> software developer <

15

Re: What's yet to come in Image Analyzer?

Basically unsharp edges will get squeezed together, so that the edge will get sharper (by edge-detecting, bluring, bump-mapping two times for X- and Y-direction and displacing)

Here are some links that may be of use:
http://www.home.unix-ag.org/simon/gimp/warp-sharp.html - script for Gimp, images for comparison and reference.
http://www.virtualdub.org/virtualdub_filters.html - plugin for Vdub and source code.

16

Re: What's yet to come in Image Analyzer?

Thanks, I might make some experiments to see if I can do something useful with the idea.

Michael Vinther

> software developer <

17

Re: What's yet to come in Image Analyzer?

I have made some experiments with a warp sharp algorithm. You can try it here:
http://meesoft.com/Analyzer/Plugins/WarpSharpPlugin.exe

Note that it requires .NET version 4.0.

Michael Vinther

> software developer <

18

Re: What's yet to come in Image Analyzer?

Thank you very much for implementing this feature. Here are some notes:
As IA launches, scanning plugins, it says it needs msvcr100.dll, despite I installed .NET 4.0. Fixed it by downloading this .dll separately.
Both Emboss and Warp Sharp plugins generate exception "External exception E0434352" whether I click OK or Cancel, closing plugin window. Though plugins successfully change image, this exception appears every time i use them. In addition, sometimes another error message is shown:

Can't load file "file:///C:\Program Files\MeeSoft\ImageAnalyzer\DotNetPlugins\mscorlib.resources.dll" or some related components. Can't find the file.

Usually it happens when I use plugin on large image and click OK/Cancel before it finishes processing.
When using low "Edge Map Smoothing" values with high "Displacement Scaling" WarpSharp "splits" already sharp edges and produces aliasing, like here:
http://img153.imageshack.us/img153/5237/imageym.png - warpsharp
http://img815.imageshack.us/img815/8421/image0.png - source image
At the same time, when there are less sharp edges, or edges between similar colors (like on photos), WarpSharp does almost nothing.

19

Re: What's yet to come in Image Analyzer?

I have uploaded a new version of the plugin at http://meesoft.com/Analyzer/Plugins/Adv … Plugin.exe
The archive now includes msvcr100.dll and mscorlib.resources.dll.

It now exists under the menu item Advanced sharpen where I have added a few more sharpen filters - Limit Sharpen and XSharpen. The IIR filter is the same as IA's build in sharpen filter.

Warp sharp has a new parameter which will limit how far away from the source it will fetch pixels. This should reduce the problem with splitting edges.

Is there any chance to implement it without the need of .NET?

Yes, that would be nice but I'm not sure I will take the time to do it. The IA program itself is implemented in Delphi but now I made these new filters in C# because Visual Studio/C# is just so much nicer and faster to work with.

Michael Vinther

> software developer <

20

Re: What's yet to come in Image Analyzer?

You can try do delete msvcr100.dll or perhaps mscorlib.resources.dll from the Image Analyzer program folder and download it from here instead:
http://www.dll-files.com/dllindex/dll-f … l?msvcr100
The files are different though I don't know why - the one I put in the installer was one I found on my computer.
Please let me know if it helps - then I can replace it.

Michael Vinther

> software developer <

21

Re: What's yet to come in Image Analyzer?

Speaking about msvcr100.dll, seems like you included x64 version of it in the installer, since it has something about AMD x86/x64 in the description and IA says "This is not proper Windows NT image" about it while loading (I am using 32-bit Windows). Version from dll-files.com works well.
As for mscorlib.resources.dll, it should be placed under "DotNetPlugins" folder, while in the installer it is in the root folder of IA. After I moved it to plugins folder, it fixed problems with exceptions and "Can't load file".

In addition to what DrJones said about .NET, I'd like to mention, that loading "DotNetPluginWrapper.dll" takes significant time thus making IA launch way slower than usually, at least on my PC.

Some suggestions about Warpsharp and other filters under "Advanced sharpen". Is there any way to make WarpSharp look less "rough", closer to how it looks in VirtualDub? Maybe I really shouldn't compare different software, but VD's plugin has source code available, so it could be easier to implement something similar. Also, speaking of first link with reference (http://www.home.unix-ag.org/simon/gimp/warp-sharp.html), have you read article, mentioned there: http://citeseerx.ist.psu.edu/viewdoc/do … p;type=pdf ? It must be that algorithm mentioned by Gimp script creators, but their script is only simplified version of it.
It might be nice to add "Filter double size image" checkbox to Advanced Sharpen, like in "Adaptive Noise Reduction". Sharping double size image could solve some troubles with aliased edges of WarpSharp and other filters.
Sorry for huge post, hope I am not too demanding.

22

Re: What's yet to come in Image Analyzer?

Thanks for the update on the DLLs. I have updated the archive with the DLLs as you suggested.

Is there any way to make WarpSharp look less "rough", closer to how it looks in VirtualDub?

I haven't tried VirtualDub but you can make the result less rough by increase the Edge map smoothing parameter.

The is a new version of the plugin available which also has a Warp sharp resize feature. It seems to be quite good at preserving edge sharpness when enlarging images.

Michael Vinther

> software developer <