SRL Archive - Help and Support

Bitmap mask request


Le Jingle

2013-01-06 23:05:50

Can anyone help me create bitmap masks for the following items?
(Only need the four different potions sizes (top row of items) + scroll and pouch (last 2 items in inventory))


I think I need Photoshop, however all I have on this is paint :/

Let me know if it's do-able,
Lj!

Gucci

2013-01-06 23:21:59

From: Le Jingle
Can anyone help me create bitmap masks for the following items?
(Only need the four different potions sizes (top row of items) + scroll and pouch (last 2 items in inventory))


I think I need Photoshop, however all I have on this is paint :/

Let me know if it's do-able,
Lj!


Should work fine in paint (that's how I do it), on phone else I would do it maybe in a bit

Olly

2013-01-07 00:29:32

I use paint aswell :p it works fine

xtrapsp

2013-01-07 05:33:46

I assume to get the mask you want us to remove the background?

(Not done masks before)

J J

2013-01-07 07:55:43

Indeed, what exactly do you mean with mask?
Here is what I thought you meant

Le Jingle

2013-01-07 11:02:42

I thought masking Bitmaps was flattening and slightly brightening an image like the tutorial by Hobbit

masterBB

2013-01-07 11:41:41

Not tested but:

function CreateMask(bitmap, brightness, contrast: Integer): Integer;
var
bmpCopy, bmpGreyScale, bmpContrast, bmpBrightness: Integer;
begin
bmpCopy := CopyBitmap(bitmap);
bmpGreyScale := GreyScaleBitmap(bmpCopy);

InvertBitmap(bmpGreyScale);

bmpContrast := ContrastBitmap(bmpGreyScale, contrast);
bmpBrightness := BrightnessBitmap(bmpContrast, brightness);

FreeBitmap(bmpCopy);
FreeBitmap(bmpGreyScale);
FreeBitmap(bmpContrast);

Result := bmpBrightness;
end;

Shatterhand

2013-01-07 13:10:15

From: Le Jingle
I think I need Photoshop, however all I have on this is paint :/

Try Paint.NET or Gimp. :)

Le Jingle

2013-01-07 13:47:40

Ah okay!

Thanks everyone! :)

WT-Fakawi

2013-01-07 15:55:17


Photoshop:
1. Make Grayscale
2. Invert
3. Brightness /Contrast all the way down/up until that ^
4. Save as bmp 8-bits

Le Jingle

2013-01-15 00:28:02

Made a snippet to help make these :)
ideas fueled via bart and sps and the srl community.


(*
procedure created to help make useful bitmap masks.
Ex. of use;
makeBitmapMask(55.0, 100, IntToBox(1, 1, 50, 50), 'C:/Users/name/Desktop/Bmp_Test.bmp');

Author Lj
*)
procedure makeBitmapMask(BMP_Contrast: extended;
BMP_Brightness : integer;
box : TBox;
path : string);
var
w, h : integer;
c : TClient;
bmp : TMufasaBitmap;
begin
w := box.X2 - box.X1;
h := box.Y2 - box.Y1;
try
bmp := TMufasaBitmap.Create;
c := getTClient;
with bmp do
begin
SetSize(w, h);
CopyClientToBitmap(c.IOManager, false, 0, 0, box.X1, box.Y1, box.X2, box.Y2);
GreyScale(bmp);
Brightness(bmp, BMP_Brightness);
Contrast(bmp, BMP_Contrast);
Invert(bmp);
SaveToFile(path);
end;
except
Writeln(' -----> ERROR making Bitmap Mask.');
finally
with bmp do Free;
end;
end;

Edit -> Modified after reviewing Hobbit's Tutorial here. :)
(suggested for items = 100.0 contrast + 100 brightness, at least that's what gets WT Fakawi's result :)