Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Erasing (or making a section of an image transparent) based on a mask from image #2?
#2
Easiest way here is just to write a loop:

Code: (Select All)
_Source image2
_Dest image1
_DontBlend 'so 0 will change and update the image rather than blend to nothing
FOR x = 0 to _width(image2)
   FOR y = 0 to _height(image2)
     IF POINT(x,y) <> 0 THEN PSET(x2 + x, y2 + y), 0 'make transparent
   NEXT
NEXT

If the point in the 2nd image isn't blank (0 , or whatever your background color might be on that image), then make that point blank on the first image.

Same way for a tolerance level.  Just change that <> 0 to the color you want, or the color range you want.

IF POINT(x,y) >= _RGBA32(100,100,100,0) _ANDALSO POINT(x,y) <= _RGBA32(100,100,100,255)....
Reply


Messages In This Thread
RE: Erasing (or making a section of an image transparent) based on a mask from image #2? - by SMcNeill - 04-13-2025, 12:11 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  error doing image collision detection with _MemGet madscijr 55 4,663 10-01-2025, 03:25 PM
Last Post: bplus
Photo from png tile, create symmetrical screen image hsiangch_ong 11 936 08-23-2025, 01:23 AM
Last Post: bplus
  need help printing a scaled string in a custom font to a 32-bit image madscijr 9 1,148 07-03-2025, 04:48 PM
Last Post: SMcNeill
  program that stitches together a bunch of image files into one giant poster? madscijr 15 2,302 10-24-2024, 06:08 PM
Last Post: madscijr
  [Solved] How come CLS clears more than the _DEST image here? Dav 2 747 10-07-2024, 12:14 AM
Last Post: Dav

Forum Jump:


Users browsing this thread: 1 Guest(s)