MaskImage

Blitz3D Forums/Blitz3D Programming/MaskImage

Zach3D(Posted 2006) [#1]
Why does maskimage never work?
Ive tried it with every version of blitz3D ive had, and when i used to have blitzbasic, MaskImage has NEVER worked for me


Ross C(Posted 2006) [#2]
Do you have an example? Like a piece of code, with an image that doesn't work?

This code here should work. If you see a white circle, with NO purple around it, it works.

Graphics 800,600
SetBuffer BackBuffer()


Global image = CreateImage(64,64)
Color 255,0,255
SetBuffer ImageBuffer(image)
Rect 0,0,64,64
Color 255,255,255
Oval 0,0,64,64

SetBuffer BackBuffer()

maskimage image,255,0,255

While Not KeyHit(1)

	Cls

	Color 100,100,100
	Rect 0,0,125,600
	Color 150,150,150
	Rect 125,0,400,600

	DrawImage image,100,100


	Flip
Wend
End



RGR(Posted 2006) [#3]
Ross C ... he means the Function MaskImage
http://www.blitzbasic.co.nz/b3ddocs/command.php?name=MaskImage&ref=comments


Ross C(Posted 2006) [#4]
Same thing really, as images have a maskimage of RGB(0,0,0) already applied. I've updated my code to be more thorough :o0


RGR(Posted 2006) [#5]
.

Last edited 2012


Ross C(Posted 2006) [#6]
No offense ;o) But, isn't it proof enough that it isn't drawing the pixels? Ayway, i wish he's post back to see if it works for him.


RGR(Posted 2006) [#7]
.

Last edited 2012


RGR(Posted 2006) [#8]
.

Last edited 2012


RGR(Posted 2006) [#9]
.

Last edited 2012


Ross C(Posted 2006) [#10]
RaGR. Stop being a cheeky git. I was saying i don't see the problem with my code. It CLEARY show that maskimage is working. That's what i'm saying. My code, doesn't need any changes or additions. If you are seeing no square behind the circle, maskimage is clearly working.

You, my friend, have an attitude problem.


RGR(Posted 2006) [#11]
.

Last edited 2012


Ross C(Posted 2006) [#12]
Why exactly do i have mental problems? You have an attitude problem and deserve to be banned from the forum for personal attacks.


Zach3D(Posted 2006) [#13]
I found that the main reason it doesnt work is.. when i load a jpg, maskimage doesnt work at all, and when i load a bmp, it works slightly ,but not much, i think the pixels arent being saved as exactly the color i want, more like 1 pixel off


Ross C(Posted 2006) [#14]
Well, when you save a .JPG, the images doesn't save exactly. The black pixel may got slightly distorted. You should never use .jpgs if you want to retain image accuracy and use things such as maskimage. Use a .png preferably, or .bmp.


jfk EO-11110(Posted 2006) [#15]
this was really funny to read. 2 guys getting in troubles while discussing about MaskImage - how about a discussion about religion or politics then? Seriously, take it easy.

Zach - never use lossy compression for images you want to mask. Jpeg is lossy, even in the best quality setting.
Instead use bmp, png, tga. Also make sure to use 32 Bit graphics since in 16 Bit mode colors will be converted to 5.6.5 Bits.

And make sure to use a reliable Painting App that will save things correctly.


Sir Gak(Posted 2006) [#16]
Roos C and jfk and right. Masking is defeated by lossy jpegs.

Also, RaGR initiates unwarranted (and unwelcome on the forum) insults, then calls the whole conversation childish. Go figure.


Ross C(Posted 2006) [#17]
Yeah, there was no need to say i have mental problems. I'm not geting worked up about the maskimage thing. Just no need for insults.


Sir Gak(Posted 2006) [#18]
There's a teaching that says, "As much as lies within you, be at peace with all men." It implicitly is indicating that there will be some who won't be at peace with you, no matter what you do, so you're on the right track by not letting it get to you.