Help - Search - Members - Calendar
Full Version: Image Converter (Beta 2) v. 1.0
Desktop Sidebar Forums > Customizations > Panel Announcements
Pages: 1, 2, 3
yyy
Image Converter (Beta 2) v. 1.0
This panel allows you to convert image files to different formats and sizes


Developed by yyy
Original idea by antu^jamban

Released on: August 25th 2005

Compatibility: The panel was tested on Desktop Sidebar build 94, Windows® XP Pro and .NET Framework v. 1.1. It should also work on some previous Desktop Sidebar builds and Windows® versions. If you are using .NET Framework v. 2.0 you might experience some display issues.

Special Thanks
  • antu^jamban for giving me the idea for this panel, creating the icons for it, testing it and helping with its development. smile.gif
  • The FreeImage Project's developers for providing me the FreeImage open source image library which the panel uses. You can find more details about it in this link: http://freeimage.sourceforge.net
  • Alex Fr who wrote an article in 'The Code Project' site which the panel's code is based on.
  • KeithI for his help with the panel's development smile.gif
Description
The Image Converter panel was created in order to allow a quick and easy conversion of images to various image types, color depths and sizes. Including support for up to 32 bit + alpha channel image export in some file formats ! It can also be used to create image thumbnails.

Features
  • Easy and quick conversion of images to and from a wide range of types using drag and drop. See the table below for a full list of supported image types.
  • Support for 32 bit + alpha channel image export in bmp,ico, png, tga and tif file formats !
  • Support for multipage icons file import.
  • The panel comes with a special image filter which allows you to filter images by their color depths, resize images (can be used to create thumbnails), set the resizing method and choose the JPEG compression ratio !
  • A new cool details window which shows additional information about the panel and the conversion process.
  • Ability to customize the messages shown in the panel.
  • Ability to pause the conversion process and stop it manually by double clicking the text while the conversion process is on.
  • Ability to choose whether to keep the converted files in their original directory or to copy them to a custom directory.
  • An option to convert files from sub folders.
  • Easy access to the converted files' directory by simply double clicking the text after the conversion is finished.
  • Comfortable user interface which allows you to quickly execute common commands by using the context menu.
  • Animated user interface.


License and Legal Issues
* This software (Image Converter panel) uses the FreeImage open source image library. See http://freeimage.sourceforge.net for details.
FreeImage is used under the GNU General Public License, version 2.


* The panel is based on Alex Fr's article in the code project ( http://www.codeproject.com/csharp/workerthread.asp ).

* This is an open source panel. It was developed using Sharp Develop in C#. You can find the source code in the panel's directory.

Dear user,
Thank you very much for using my panel - I hope you enjoy it. Many efforts were made to ensure that this panel will work flawlessly. If you happen to find any bugs, or have any suggestion, feel free to report or suggest! I'll be happy to help.

Note: I release this version as a beta version as it has many new features. If there are no too many problems with it, it'll be released officially soon smile.gif

Enjoy
Click to view attachment
GoMa
Another excellent panel by yyy! My limited tests all worked perfectly (including a simple icon conversion). fun_08.gif
yyy
Cool cool.gif Thanks a lot for testing the panel smile.gif I was worried it might not convert some icons fine so I'm happy to see it's fine with what you've tested smile.gif Enjoy the panel smile.gif
antu^jamban
Well done clap.gif fun_08.gif

In your first post, can you please group the * items together so they can be read easily. You should also mention that this panel support 32-bit BMP so people will know about it.

My test results (so far):
BMP (32-bit with alpha channel) --> PNG, TGA, TIFF, ICO - converted succesfully with its alpha channel intact
ICO --> BMP, PNG, TIFF, TGA - converted succesfully with its alpha channel intact
PNG --> BMP, ICO, TIFF, TGA - - converted succesfully with its alpha channel intact
TGA --> TIFF, BMP, PNG - converted succesfully with its alpha channel intact. The alpha channel is lost when converted to ICO.

- Successfully converted mutiple files
- Successfully converted mutiple files in sub folders (3 level)
- Failed to convert all files in sub folders (3 level) containing BMP, PNG, TIFF, ICO. Only BMP converted succesfully. PNG is converted but corrupted. All files are converted to TGA in this test

- Panel set to ignore all bit type except for 32 bit. Converted several BMP file which is one of them is 32 bit. The file converted to PNG succesfully but converted filename mention in the panel is wrong. This happen when you select 32 bit BMP first and followed by non-32 bit BMP

*All BMP file used in this test is in 32-bit unless mentioned otherwise

More test results are coming biggrin.gif

EDIT:
I just noticed. You should put this panel in Graphics cat. instead of Accessories
yyy
QUOTE
In your first post, can you please group the * items together so they can be read easily. You should also mention that this panel support 32-bit BMP so people will know about it.


I thought of that, but I can't relate to only one format (bmp) while there are others which support that color depth. I think I'll write what format support what color depth.

QUOTE
BMP (32-bit with alpha channel) --> PNG, TGA, TIFF, ICO - converted succesfully with its alpha channel intact
TGA --> TIFF, BMP, PNG - converted succesfully with its alpha channel intact. The alpha channel is lost when converted to ICO.


Ok, I'll take a look at this. As I said, ICO is quite problematic.


QUOTE
- Successfully converted mutiple files
- Successfully converted mutiple files in sub folders (3 level)
- Failed to convert all files in sub folders (3 level) containing BMP, PNG, TIFF, ICO. Only BMP converted succesfully. PNG is converted but corrupted. All files are converted to TGA in this test


That's weird huh.gif I've tested the panel with sub folders which are in sub folders and it worked. Can you tell me exactly how many sub folders you had and what was converted? I'd also like to see the corrupted PNG.


QUOTE
- Panel set to ignore all bit type except for 32 bit. Converted several BMP file which is one of them is 32 bit. The file converted to PNG succesfully but converted filename mention in the panel is wrong. This happen when you select 32 bit BMP first and followed by non-32 bit BMP


Do you mean it also converted a non 32 bit image?
About that wrong file name - yes, you're right. rolleyes.gif I've just looked at teh code and it seems like I've missed it dry.gif laugh.gif Thanks for telling me.

I'll wait for the rest of the result. There shouldn't be too many problems with 32 bit conversions, but I know that some file types aren't converted right. I'm not sure if that's because of the FreeImage library, the software you use to see the images, or the code rolleyes.gif So if you find something which isn't convertede right, send it to me and I'll see what I can do.

EDIT:
Isn't it in the Graphics category? It is shown there on my computer huh.gif Probably a wrong version. It'll be fixed in the next release.
antu^jamban
QUOTE(yyy @ Aug 10 2005, 07:55 AM)
QUOTE
In your first post, can you please group the * items together so they can be read easily. You should also mention that this panel support 32-bit BMP so people will know about it.


I thought of that, but I can't relate to only one format (bmp) while there are others which support that color depth. I think I'll write what format support what color depth.

You could wrote something like: BMP (32-bit supported) wink.gif

QUOTE
QUOTE
- Successfully converted mutiple files
- Successfully converted mutiple files in sub folders (3 level)
- Failed to convert all files in sub folders (3 level) containing BMP, PNG, TIFF, ICO. Only BMP converted succesfully. PNG is converted but corrupted. All files are converted to TGA in this test


That's weird huh.gif I've tested the panel with sub folders which are in sub folders and it worked. Can you tell me exactly how many sub folders you had and what was converted? I'd also like to see the corrupted PNG.

Here is how the folder looks like:
Folder > sub folder > sub folder > sub folder. In each of them I placed different type of file. BMP in 1st folder, 2nd PNG, 3rd TIFF and finally ICO. PNG and TIFF converted with 0 byte TGA file. I attached the corrupted TGA (not PNG) in a zip. It keeps its alpha channel even tho its corrupted.

QUOTE
QUOTE
- Panel set to ignore all bit type except for 32 bit. Converted several BMP file which is one of them is 32 bit. The file converted to PNG succesfully but converted filename mention in the panel is wrong. This happen when you select 32 bit BMP first and followed by non-32 bit BMP


Do you mean it also converted a non 32 bit image?
About that wrong file name - yes, you're right. rolleyes.gif I've just looked at teh code and it seems like I've missed it dry.gif laugh.gif Thanks for telling me.

laugh.gif

Also, please re-read my post above. I edited it to include additional info.
yyy
I can't write BMP (32 but supported) because then I'll also have to write BMP (1 bit, 4 bit .... 128 bit supported) biggrin.gif I prefer to add a table which shows exactly which formats supports which color depths. There's one in the FreeImage documentation so it'll be easy to make.

I've also tried it with these number of subfolders and it worked. I guess the reason it didn't work for you is that it couldn't convert these files. Anyway, I need to original files so I can test them on the panel and see what's wrong. So if there's a file which isn't converted right, send it to me and tell me to what format you wanted to convert it.

Thanks again for testing the panel smile.gif
antu^jamban
QUOTE
QUOTE(antu^jamban @ Aug 10 2005, 08:10 AM)

QUOTE(yyy @ Aug 10 2005, 07:55 AM)
QUOTE
In your first post, can you please group the * items together so they can be read easily. You should also mention that this panel support 32-bit BMP so people will know about it.


I thought of that, but I can't relate to only one format (bmp) while there are others which support that color depth. I think I'll write what format support what color depth.

You could wrote something like: BMP (32-bit supported) wink.gif

Correction of my post. You miss-understood me. What I mean is instead of you mixing up the convertable and non-convertable files, it is much more easier to identify the convertable formats if you list them after or before the non-convertable format. Something like this:

* item 1
* item 2
non-convert 1
non-convert 2

Secondly, modified this line --> *Windows or OS/2 Bitmap File (*.BMP) say to..
*Windows or OS/2 Bitmap File including 32-bit (*.BMP). So users will know that this panel supports 32-bit BMP. Not many of us know that 32-bit BMP existed smile.gif
antu^jamban
QUOTE(yyy @ Aug 10 2005, 08:21 AM)
I can't write BMP (32 but supported) because then I'll also have to write BMP (1 bit, 4 bit .... 128 bit supported)  biggrin.gif I prefer to add a table which shows exactly which formats supports which color depths. There's one in the FreeImage documentation so it'll be easy to make.

Oh you're right biggrin.gif

QUOTE
I've also tried it with these number of subfolders and it worked. I guess the reason it didn't work for you is that it couldn't convert these files. Anyway, I need to original files so I can test them on the panel and see what's wrong. So if there's a file which isn't converted right, send it to me and tell me to what format you wanted to convert it.

Thanks again for testing the panel smile.gif
*


You're welcome. BTW, you already have the original file. Its the Bitmap_128.bmp. In the test, I converted it to PNG 1st before converting it to TGA. PNG converted right to TGA as I mention in my test result.
yyy
OK, I understand it. About the organization of readable only and writeable formats I agree. I will change it. But as for the supported formats, I want to do something like this: (Taken from the FreeImage documentation)

Image removed
yyy
QUOTE
You're welcome. BTW, you already have the original file. Its the Bitmap_128.bmp. In the test, I converted it to PNG 1st before converting it to TGA. PNG converted right to TGA as I mention in my test result.
*


That's just what I did now and it worked fine. Can you test it again and tell me if it still does this?
antu^jamban
Cool!!! fun_08.gif You're going to include it with the panel to right?
yyy
You mean the table or all the formats? I'll put something like this table at the first post. Most formates in this table are already supported. I only have to fix the way the panel loads and export the files.
antu^jamban
Hmm weird. They converted to TGA correctly this time. Maybe this had to with the filename.. I'm not sure. Before this all the images are named Bitmap_128_ except for the BMP in the first folder. Now that I rename them back and remove the underscore, all of them converted correctly.
antu^jamban
QUOTE(yyy @ Aug 10 2005, 08:34 AM)
You mean the table or all the formats?
*


I mean the table above. I was thinking that maybe you want to include it in CHM file of your panel smile.gif
yyy
I'll see what's wrong with the file naming. About the table, I might add it as an image to the panel. That's a good idea. A CHM file will take me a lot of time rolleyes.gif
antu^jamban
Cool!

I don't think it took a lot of time (unless you want to do it using tables. what a nightmare laugh.gif). Just slapped that image into CHM. Done. I think I can do that pretty quick.
yyy
I ment writing the CHM itslef. If I use a CHM file I'll have to right some information about how to use the panel and etc. This will take time. I thought I'll just create a *.doc file with a table and link to it from the panel.
antu^jamban
Do what you think suits best. The most important thing now is that this panel is working. I'm already having fun with it biggrin.gif (/me says goodbye to good old app laugh.gif)
yyy
OK, I'll think about it. I'm happy to see you enjoy the panel. I'll try to make it perfect like your good old app laugh.gif

EDIT:
It's already 4 A.M. in here so I'm feeling quite tired biggrin.gif Then I'll go to sleep now. I'll try to fix the panel tomorrow. Have a nice day smile.gif
antu^jamban
Another good colab with my good old friend biggrin.gif (/me shake hand with yyy) wink.gif
yyy
laugh.gif fun_08.gif
yyy
QUOTE(antu^jamban @ Aug 10 2005, 03:36 AM)
Hmm weird. They converted to TGA correctly this time. Maybe this had to with the filename.. I'm not sure. Before this all the images are named Bitmap_128_ except for the BMP in the first folder. Now that I rename them back and remove the underscore, all of them converted correctly.
*


You mean it gave the file a wrong name? That's weird since I don't see anything wrong in the code.
yyy
QUOTE(antu^jamban @ Aug 10 2005, 02:42 AM)
TGA --> TIFF, BMP, PNG - converted succesfully with its alpha channel intact. The alpha channel is lost when converted to ICO.


Does it work fine if you convert it first to PNG and then to ICO?

EDIT:
Oh, sorry - I've foujnd the problem and it's fixed. I was doing somthing wrong rolleyes.gif

BTW, do you have the icon you did for this panel in a higher resolution? Something like 48 by 48 will be nice.
antu^jamban
QUOTE(antu^jamban @ Aug 10 2005, 07:42 AM)
- Panel set to ignore all bit type except for 32 bit. Converted several BMP file which is one of them is 32 bit. The file converted to PNG succesfully but converted filename mention in the panel is wrong. This happen when you select 32 bit BMP first and followed by non-32 bit BMP
*


I've recreated the above situation and all of them are converted without a problem. Funny.. at first I thought it has problem with filename but now it's ok. Maybe caused by my crap PC smile.gif

I suggest that you change its status (label) to "Converting..." when convertion take place and prevent it from accepting any file at this point (if you haven't done it yet)

I was thinking the same at about the icon. I will make one in my freetime wink.gif

It's good to know that you fixed those bug. Keep it coming fun_08.gif

BTW, this window pop up when I try to open its Properties Window. I clicked OK then try to open again and it opens without problem.
yyy
At first I wanted to set the label to write "Converting..." but I knew it'd require me to use a thread and since I'm not that familiar with that I've decided to postpond it for the next version. I'll also show exactly how many files were converted and how many panels should be while the conversion process is on.
I'll be happy if you create a special icon for that smile.gif

I was trying to find what caused the error you showed but I couldn't find any solution. Does it always happen?
antu^jamban
Good to know that.

Is it possible to animate icons? It would be so cool biggrin.gif (AFAIR we can't animate stuffs in DS) If not then I will create special icon for it.

The error just occur once. I will let you know if it happens again.
yyy
That's funny because I was just thinking of that laugh.gif I can try to find a way to animate it, but I don't have any animation. If you can do it, I'll try to put it in the panel.

About the error message, I changed something in the code now that I thik could cause the error. Maybe it's the solution. If you have that problem again, show me your log file too - it might give me some clues.
KeithI
QUOTE
At first I wanted to set the label to write "Converting..." but I knew it'd require me to use a thread
You may be able to do that without needing a thread, as follows:
CODE
mylabel.Text = "Converting...";
Application.DoEvents();
However, if you're doing lots of work then perhaps a seperate thread to do it would be a better idea.
antu^jamban
QUOTE(yyy @ Aug 10 2005, 11:44 PM)
That's funny because I was just thinking of that  laugh.gif I can try to find a way to animate it, but I don't have any animation. If you can do it, I'll try to put it in the panel.

About the error message, I changed something in the code now that I thik could cause the error. Maybe it's the solution. If you have that problem again, show me your log file too - it might give me some clues.
*


About the animation, I was thinking that maybe the arrows will move around (circular motion) until the process is complete biggrin.gif

Here is part of log:
QUOTE
22:03 .\BackgroundJobs.cpp 211 BackgroundJobs thread finished 2920
22:04 .\CommandManager.cpp 1223 DispatchCommand panelproperties
22:04 .\MainWnd.cpp 3570 Image Converter v. 0.9 >> Loading panel properties dialog box > Overflow or underflow in the arithmetic operation.
22:04 .\CommandManager.cpp 1223 DispatchCommand panelproperties
22:05 .\MainWnd.cpp 2421 CheckForUpdates disabled
22:08 .\BackgroundJobs.cpp 178 BackgroundJobs thread started 2152
22:08 .\CommandManager.cpp 1223 DispatchCommand panelproperties
22:08 .\BackgroundJobs.cpp 211 BackgroundJobs thread finished 2152


I donno about those thread and stuffs.. but I think this panel will possibly freeze DS if the converting process took too long. Am I right or wrong here?
KeithI
If you do the conversion in a seperate thread then you are free to update the UI with whizzy graphics or whatever to indicate that it is processing. I see no reason why you couldn't show an animated GIF, for example.

...and Antu is correct that if you don't use a thread then it will lock DS whilst it is processing.
yyy
KeithI - thanks, I didn't know about that laugh.gif That's really useful. But I see that antu^jamban is concerned about DS getting freezed so I guess I'll use a thread anyway.

antu_jamban - Yes, the arrows animation is a good idea. I'll try to do it.
About the error - I hoped the log files will show more information. From what I've heard, that error can be caused by another application but I've no idea what kind of application. I hope it won't happen with the next version.

Currently the panel freezes DS but I'll add threads finction to the next releases so it won't happen.
yyy
QUOTE(KeithI @ Aug 10 2005, 07:04 PM)
If you do the conversion in a seperate thread then you are free to update the UI with whizzy graphics or whatever to indicate that it is processing. I see no reason why you couldn't show an animated GIF, for example.

...and Antu is correct that if you don't use a thread then it will lock DS whilst it is processing.
*


Ok, thanks. That's what I'll do. But, do you think I can show an animated gif in an ISkinButton, or should I use a pictureBox?
KeithI
Check this out for information about animating in C#. I don't think an ISkinButton would work.
antu^jamban
QUOTE(KeithI @ Aug 11 2005, 12:04 AM)
...and Antu is correct that if you don't use a thread then it will lock DS whilst it is processing.
*


Thankiez biggrin.gif
yyy
QUOTE(KeithI @ Aug 10 2005, 07:12 PM)
Check this out for information about animating in C#. I don't think an ISkinButton would work.
*


Ok, I don't think I need it - putting a gif in a picture box is enough. I just wondered if I can put it in an ISkinButton so it'll be easier.

EDIT:
BTW, how's that:
antu^jamban
COOL!!! laugh.gif
yyy
Update:

Using a thread to execute the conversion process - completed smile.gif Thanks to KeithI.
Using animated arrows while the conversion process is running - completed smile.gif
antu^jamban
Nice work. Any other planned updates?

For converting to icon, can you make an option to select icon size? One size or multiple sizes.

Icon size:
- 256x256
- 128x128
- 96x96
- 72x72
- 64x64
- 48x48
- 32x32
- 24x24
- 16x16
- Custom size: range - 8x8 to 512x512
yyy
The problem is that the FreeImage library is limited to 16x16 - 128x128 icon size so that's the only range available. I can add an option to adjust the icon size, but I don't know how to save an icon with mulitple sizes in it rolleyes.gif I might try it but I can't prmoise.
Prism
Why won't you enter with this panel into the contest?
yyy
What contest? I'm not sure users can already enter their work for the second contest yet... And there hasn't been any official announcement about it either rolleyes.gif
eitaneko
Neil called it a "beta announcement". It's in the old contest thread, but i know you have some insane amount of posts on a page, so I can't tell you which one it is on. 2/3 of the way through is the best i can do.
yyy
Yes, I saw it but I wasn't sure if it's official or not. I rather wait for the official announcement and then decide.

I have the maximum posts per page which is 40 but I wish we could have even more. With today's broadband connections even long pages can be loaded in seconds.
antu^jamban
QUOTE(yyy @ Aug 12 2005, 05:50 PM)
The problem is that the FreeImage library is limited to 16x16 - 128x128 icon size so that's the only range available. I can add an option to adjust the icon size, but I don't know how to save an icon with mulitple sizes in it  rolleyes.gif I might try it but I can't prmoise.
*


All right then. You might want to suggest them to add support for larger/custom icon size wink.gif
yyy
I've asked them and the developer said he was using another code which was also limited. He also said that most programs uses 48x48 images. I hope he'll change it one day.
yyy
Update:

- Options to resize images (including icons) added. Now you can use it to create thumbnails smile.gif

- Option to stop conversion before it ends added.
antu^jamban
I'm having issue when converting this icon (icon attached). I converted this icon to PNG and I expect to get 48x48 XP icon but what I get is 48x48 16 (color) icon as you can see in the screenshot.

I'm started to think that this panel get confused of which icon type to extract because there are 3 types of icon having the same size. I hope you can track down this problem smile.gif

BTW, can you tell me the compression factor/ratio of JPG file created by this panel?

user posted image
yyy
You're right - I'll try to find a solution although the panel was orginialy made to allow image conversion and not icons so these kinds of problems can happen.

About the ratio - currently it is 75:1 but I can set it to 100:1 if you want. I'll add an option to choose the ratio.
antu^jamban
Limiting the bit depth also can't help even tho those 3 are (from right) 4 bit, 8 bit and 32 bit.

Adjusting ratio is useful to fine tune the JPG quality, so why not have it wink.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.