Search Unity

Photo Editing / Manipulating in Unity

Discussion in 'Scripting' started by g8minhquan, Sep 30, 2014.

  1. g8minhquan

    g8minhquan

    Joined:
    Jun 18, 2014
    Posts:
    38
    Hi,
    I would like to create a game that let user take photo from webcam / mobile camera then do some cropping and draw some overlay images on top of the cropped photo.
    Is there a way to do it in Unity?
    Are there some packages on the Asset Store that can help me do it?
     
  2. DarkArts-Studios

    DarkArts-Studios

    Joined:
    May 2, 2013
    Posts:
    389
    You can definitely do this, as I do quite a bit of image transforms in one of my own Asset Store products (unfortunately that won't help with what you're attempting to do though).

    You would have to do this manually through pixel manipulation, for example see:
     
  3. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
    I Wouldn't go for pixel editing, that's destructive, and makes doing things like moving overlays around extremely intensive.
    Just have the source photo on one plane, then layer others on top of it.
    So... "Is there a way to do it in Unity?" - Yes, easily.
     
  4. DarkArts-Studios

    DarkArts-Studios

    Joined:
    May 2, 2013
    Posts:
    389
    The OP specifically mentions cropping, which is, by it's very nature, destructive.
     
  5. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
    Yeah but you can achieve the same by just modifying the UVs on the plane that the texture is displayed on, preserving the source image.
     
  6. g8minhquan

    g8minhquan

    Joined:
    Jun 18, 2014
    Posts:
    38
    Thanks for the hints, guys.
    @hpjohn: how can I save the final, combined image then?
     
  7. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
    g8minhquan likes this.
  8. g8minhquan

    g8minhquan

    Joined:
    Jun 18, 2014
    Posts:
    38
    Many thanks for the information. I'll try implementing it
     
  9. MrAdrenaline

    MrAdrenaline

    Joined:
    Oct 23, 2019
    Posts:
    2
    Thank you for the provided information, really useful one, I will try to implement it in my own project