Git Product home page Git Product logo

Comments (17)

Scr34mik avatar Scr34mik commented on August 25, 2024 1

DrawImage. We have API docs.

thanks, ive ended up doing it like this :
img.Mutate(x => x.DrawImage(logo, new Point(1,1), opacity: 0.5f));

also, more examples would be nice. just having API docs is not sufficient.

from imagesharp.

JimBobSquarePants avatar JimBobSquarePants commented on August 25, 2024 1

also, more examples would be nice. just having API docs is not sufficient.

We have a samples repo, thousands of reference unit tests and a discussions channel for asking and answering such questions.

You however chose to ignore all of the above and spam an old closed issue instead. Maybe if you took the time time and effort to actually read you would be better off.

from imagesharp.

JimBobSquarePants avatar JimBobSquarePants commented on August 25, 2024

From @dlemstra on September 7, 2016 8:59

@JimBobSquarePants We call this Compose in ImageMagick. Maybe we should add a Compose Sampler? I can add this.

from imagesharp.

JimBobSquarePants avatar JimBobSquarePants commented on August 25, 2024

There's no 2D drawing in ImageProcessor yet.....
I have an open ticket #264 that would cover paths etc but that still has work to do. Whatever we make I want it to be feature rich, easy to use and powerful. The architecture would be difference from the standard samplers.

from imagesharp.

JimBobSquarePants avatar JimBobSquarePants commented on August 25, 2024

From @dlemstra on September 7, 2016 9:30

This is not drawing text/paths. Its drawing one image on top of another image. In other words copy pixels from the source image to the destination image. I would prefer to do this in a Compose sampler so we could add features like only copying one channel.

from imagesharp.

JimBobSquarePants avatar JimBobSquarePants commented on August 25, 2024

@dlemstra I'd actually like to have a look at splitting channels. The blend processor can merge based on lerping but that's all or nothing.

from imagesharp.

JimBobSquarePants avatar JimBobSquarePants commented on August 25, 2024

From @Emyr42 on September 13, 2016 17:11

using (Graphics g = Graphics.FromImage(_resultImage)) { g.DrawImage(_otherImage, x, y); }

Create an ImageFactory using a Stream (wherever you got _otherImage, or save _otherImage to a MemoryStream)...

_otherImageFactory.Overlay(
    new ImageLayer
    {
        Image = _resultImage,
        Position = new System.Drawing.Point(x, y)
    }
);

Maybe Overlay needs more parameters?

from imagesharp.

JimBobSquarePants avatar JimBobSquarePants commented on August 25, 2024

THATS NOT CORE

from imagesharp.

JimBobSquarePants avatar JimBobSquarePants commented on August 25, 2024

From @Emyr42 on September 13, 2016 21:34

No need to shout. Other projects make it a little more obvious by having distinct repositories.

from imagesharp.

JimBobSquarePants avatar JimBobSquarePants commented on August 25, 2024

From @Emyr42 on September 13, 2016 22:32

        using (FileStream streamFoo = File.OpenRead(@"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\ProjectTemplates\Extensibility\1033\VSShellTemplate\VSShellStubExe\Documentation\Images\AppEnv.jpg"))
        using (FileStream streamBar = File.OpenRead(@"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\InstallShield\InstallShieldProject\1033\IS-text-200wide.jpg"))
        using (FileStream output = File.OpenWrite(@"C:\Users\aam00\Desktop\foobar2.jpg"))
        {
            Image imageFoo = new Image(streamFoo);
            Image imageBar = new Image(streamBar);


            imageFoo.Blend(imageBar, 100);

            imageFoo.Save(output);
        }

This works, overlaying at (0,0).

foobar

This fails silently if the file already exists. Setting the stream length to 0 doesn't truncate it.

I also tried positioning the overlay:

imageFoo.Blend(imageBar, 100, new Rectangle(50, 30, imageBar.Width, imageBar.Height));

The Rectangle parameter doesn't behave as expected. Rather than being sizing for the positioned image, the width and height seem to crop the overlay relative to (0,0).
foobar2

from imagesharp.

JimBobSquarePants avatar JimBobSquarePants commented on August 25, 2024

Sorry, didn't mean to. Was on my phone. Will have a proper look when I get to a desktop.

from imagesharp.

JimBobSquarePants avatar JimBobSquarePants commented on August 25, 2024

@Emyr42 You're absolutely correct. We need another parameter, most likely a rectangle, the first rectangle signifies the area of interest of the image to blend. The second would represent to location to drop the image.

My thought would be that if the second rectangle dimensions do not match that of the source image we would scale it.

What do you think?

from imagesharp.

JimBobSquarePants avatar JimBobSquarePants commented on August 25, 2024

Oh @Emyr42 meant to ask,

This fails silently if the file already exists. Setting the stream length to 0 doesn't truncate it.

What do you mean by this?

from imagesharp.

danpetitt avatar danpetitt commented on August 25, 2024

I don't think auto scaling would be good. I have a use case for this for TV/movie images; we have need for getting promotional images and then having to 'blend', with a transparency layer, a small channel attribution logo in the corner of the image so I need the images to retain their size and aspect.

from imagesharp.

JimBobSquarePants avatar JimBobSquarePants commented on August 25, 2024

Blend now supports setting the position and the size of the overlaid image. Composition is also premultiplied for better blending (I think I got the maths correct for that).

calliphora

from imagesharp.

Scr34mik avatar Scr34mik commented on August 25, 2024

Hello, i cant seem to find .Blend() extension for "Image". I'm currently working with xamarin.mac project. Is there any replacement ?

from imagesharp.

JimBobSquarePants avatar JimBobSquarePants commented on August 25, 2024

DrawImage. We have API docs.

from imagesharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.