Comments (17)
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.
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.
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.
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.
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.
@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.
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.
THATS NOT CORE
from imagesharp.
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.
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).
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).
from imagesharp.
Sorry, didn't mean to. Was on my phone. Will have a proper look when I get to a desktop.
from imagesharp.
@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.
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.
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.
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).
from imagesharp.
Hello, i cant seem to find .Blend() extension for "Image". I'm currently working with xamarin.mac project. Is there any replacement ?
from imagesharp.
DrawImage
. We have API docs.
from imagesharp.
Related Issues (20)
- Error SixLabors.ImageSharp.ImageFormatException: 'Unexpected chunk followed VP8X header' HOT 3
- File (detected as bmp) fails to open, consumes a lot of memory HOT 4
- regression on latest.. 3 vs 2 with GIF HOT 6
- APNG Decoder incorrectly handles frame offsets and dispose previous with blend over HOT 3
- Hard crash (Internal CLR error) with corrupt PNG image HOT 3
- File conversion from jpg to webp changes colors of the image HOT 1
- Malicious hand-crafted PNG can be used to trigger DOS attack HOT 14
- I have encountered a bug with heigh and width of image HOT 4
- Missing Separable Blending Modes? HOT 2
- AccessViolationException when loading corrupt GIF
- Loading image with DecoderOptions { MaxFrames = 1 } loads multiple frames for attached png file
- Rotation of AffineTransform seems to offset the image by 1 pixel HOT 29
- After the jpeg image is loaded, there is a problem with the image color HOT 1
- Issue for load image in table cell in ver. 3.1.4 HOT 1
- Payloads that caused a DOS attack (GIF / JPEG) HOT 5
- Webp encoding produces completely transparent images HOT 5
- PNG to WebP conversion: some files 10x larger than with `cwebp` HOT 3
- PngEncoder ignores FilterMethod HOT 2
- `Fatal error. Internal CLR error` when working with image created by pointer-based overload of `Image.WrapMemory<TPixel>` HOT 1
- Issues Loading JFIF/JPG images from S3 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagesharp.