x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Cut out black background from white and black image

I've recently been trying to think of a way of cutting an object from a transparent background. The best explanation to what I want to do is using pictures. Picture before:
Before
And after:
After
As you may have noticed, I have uploaded black'n'white images, because I have an access to the transparency channel. My approach would be to get the coordinates of the first white pixel within the image and the extents of the box. Then accordingly cut the fragment out. How would I go about doing it? Is this effect possible to achieve using Unreal's materials? If not, is there a way to do it elsewhere inside Unreal or maybe even using any kind of software that could be shipped with the project?
Thanks in advance for any tips!

Product Version: UE 4.20
Tags:
before.png (7.2 kB)
after.png (4.9 kB)
more ▼

asked Oct 17 '18 at 07:39 PM in Using UE4

avatar image

xSheim
120 4 8 15

avatar image xSheim Oct 17 '18 at 07:46 PM

Also, if I could find the median point of the opaque part of image, I could scale it to match my preferences, but the problem is I don't know how to get the coords of this point

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Take a look at this: https://www.youtube.com/watch?v=mzairog7Elw&list=PLuqNhfvpWXRgjjomUESUtTAKA3-oUpACq and its download in the description.

more ▼

answered Oct 18 '18 at 01:07 PM

avatar image

Luos
9k 282 60 325

avatar image xSheim Oct 18 '18 at 04:08 PM

Nice stuff, though I am actually interested in finding the exact positions of the bounding pixels procedurally, as I don't have them hard-coded. I think I found a way to do so using CPP/Blueprints. When I'm ready I'll post an answer if anybody wants it

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question