News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

A Bitmap Editor

Started by Darrel, July 13, 2006, 11:58:50 AM

Previous topic - Next topic

Darrel

Updated drawing functions.

Darrel

Fixed a problem with opening a bitmap with 256 or fewer colors.

soulee

Hello,Darrel

I just checked it on my winxp,then I found a good function. :U
I have open a 24-bpp bitmap  save to a 8-bpp or 4-bpp,then I find the bitmap display effect is very good.

How are you make it? :dazzled:

Regards,

Soulee

Darrel

Hello soulee,

I believe it's called an octree. Anyway you sum all the seperate RGB components and divide by the total number of pixels to get an average RGB for the entire bitmap. Then do a sum of differences squared of the seperate RGB components and the average RGB components. Take the greatest of these 3 sums and find the most balanced value of this component where approxiamtely half of them are below and half above. Then repeat the process for 2 average colors and their sums of differences squared. Then choose the greatest of the 2 sums of sums of differences squared and take the greatest of its 3 component sums of differences squared and find the most balanced value of this component where approxiamtely half of them are below and half above. Then repeat as necessary until you have the number of colors you want in your bitmap. Then use Floyd-Steinberg dithering to get the resultant color reduced bitmap.

Hope that answers your question.

Regards,

Darrel

soulee

Hello Darrel,


octree?  :red
Can you post interrelated masm or c code?

Regards,

soulee

Darrel

Sorry, I have no code available for public consumption.

Regards,

Darrel

soulee

Darrel,

I found a problem,
when it run at 256 colors,open image don't use color palette.

soulee

Darrel

soulee,

I can't duplicate your problem. When I open an 8 bpp bitmap it opens at 8 bpp and when I open a true color bitmap it opens at 24 bpp.

Regards,

Darrel

Darrel

Added a Sharpen filter.  Added some support for OpenGL (under Options). The 3D Block works with 6 picture files the order when opening them is Front-Back-Left-Right-Top-Bottom. The height and width of the block is determined by the front picture. The depth of the block is determined by the left picture. Haven't figured out yet how to take more advantage of OpenGL, oh well it's a start.

Also fixed some display problems associated with covering and uncovering ABitmapEditor's main window in particular if you have a  selected bitmap over the main bitmap.

Regards,

Darrel   :8)

PBrennick

Darrel,
What do I think about your Bitmap Editor? I love it!
What do I think about your flag? I hate it! It is difficult to read your posts, my eyes keep wandering to it.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

Darrel

Quote from: PBrennick on April 22, 2007, 02:33:02 PM

What do I think about your flag? I hate it! It is difficult to read your posts, my eyes keep wandering to it.


Paul,

I'll probably change back to Laurel-n-Hardy before too long. I was just showing what could be made with the 3D Flag routine. I kinda like the flag tho'.   :bg

Regards,

Darrel

Darrel

Added support for drawing arcs and pies and using antialiasing. Thanks ramguru

Regards,

Darrel

ramguru

This is nice indeed  :U
I have further suggestions  :dance:
1) How about 32bit color support (this is a must for ico format)
  a) if editor had 32bit support, object pack like in axialis icon editor would be amazing feature (I'm sure it's not difficult to implement)
2) How about optional grid (when creating ico, cur this would be useful)

Thanks for new version

Darrel

Added a grid option for zoom level 800%. Also added Blend function.

Regards,

Darrel

ramguru

Thanks for new features,
however, grid should consist of one pixel width lines (not two), and using some less eye-stressful color like gray :)