Search found 18 matches

by GoncaloM
2019-05-30T06:18:54-07:00
Forum: Magick.NET
Topic: How to get an equivalent Magick.NET script from a command-line command?
Replies: 9
Views: 109245

Re: How to get an equivalent Magick.NET script from a command-line command?

2- Output set with 1920x1280 (width > height) - The result is not what I wanted: ... But what is wrong with it? What do you want instead? Basically what I need to do is something like a mobile splash screen image generator. Do you know how it usually works best for the transformations for landscape ...
by GoncaloM
2019-05-29T15:21:51-07:00
Forum: Magick.NET
Topic: How to get an equivalent Magick.NET script from a command-line command?
Replies: 9
Views: 109245

Re: How to get an equivalent Magick.NET script from a command-line command?

Hi. So I have the following code: using (MagickImage image = new MagickImage(ssimageBinary)) { //Define density if set in the input if(sstargetDensity > 0) image.Density = new Density(sstargetDensity); MagickGeometry size = new MagickGeometry(sstargetWidth, sstargetHeight); size.FillArea = true ...
by GoncaloM
2019-05-29T08:38:27-07:00
Forum: Magick.NET
Topic: How to get an equivalent Magick.NET script from a command-line command?
Replies: 9
Views: 109245

Re: How to get an equivalent Magick.NET script from a command-line command?

Hi. So I have the following code: using (MagickImage image = new MagickImage(ssimageBinary)) { //Define density if set in the input if(sstargetDensity > 0) image.Density = new Density(sstargetDensity); MagickGeometry size = new MagickGeometry(sstargetWidth, sstargetHeight); size.FillArea = true ...
by GoncaloM
2019-05-29T00:45:49-07:00
Forum: Magick.NET
Topic: How to get an equivalent Magick.NET script from a command-line command?
Replies: 9
Views: 109245

Re: How to get an equivalent Magick.NET script from a command-line command?

Hello. I'm using the code above but now I'm having an issue on the procedure to take, meaning, according to the initial image size (square or rectangle width > height or height > width) and, according to the final transformation size width > height or height > width I'm getting some images cut, for ...
by GoncaloM
2019-05-27T00:50:50-07:00
Forum: Magick.NET
Topic: How to fit image sizes correctly
Replies: 15
Views: 161373

Re: How to fit image sizes correctly

Hello.
The answer is in this post: https://imagemagick.org/discourse-serve ... 28#p166328
Cheers
by GoncaloM
2019-05-27T00:42:25-07:00
Forum: Magick.NET
Topic: How to get an equivalent Magick.NET script from a command-line command?
Replies: 9
Views: 109245

Re: How to get an equivalent Magick.NET script from a command-line command?

You will need to change: new MagickGeometry(sstargetWidth, sstargetHeight) into new MagickGeometry($"{sstargetWidth}x{sstargetHeight}^") or add size.FillArea=true; And you could also use ssnewImage = image.ToByteArray(MagickFormat.Png); Hi dlemstra. That worked perfectly, thank you very much. Also ...
by GoncaloM
2019-05-26T14:54:00-07:00
Forum: Magick.NET
Topic: How to get an equivalent Magick.NET script from a command-line command?
Replies: 9
Views: 109245

How to get an equivalent Magick.NET script from a command-line command?

Hi everyone. I'm trying to achieve some transformations on images using Magick.NET and I got some useful help by getting the right command-line: magick C:\Users\gm\Desktop\Vader.jpg -resize 1280x1920^^ -gravity center -crop 1280x1920+0+0 +repage C:\Users\gm\Desktop\Vader.jpg The problem is that I'm ...
by GoncaloM
2019-05-26T07:55:37-07:00
Forum: Magick.NET
Topic: How to fit image sizes correctly
Replies: 15
Views: 161373

Re: How to fit image sizes correctly

Ok, so that was the issue, great!
Now I just need to understand how can I map it to Magick.NET. What's the meaning of that symbol "^" and in the crop what means the "+0+0 " after the Crop operation? Maybe by knowing the meaning it is easier.
by GoncaloM
2019-05-25T15:28:39-07:00
Forum: Magick.NET
Topic: How to fit image sizes correctly
Replies: 15
Views: 161373

Re: How to fit image sizes correctly

I tried in the command-line but I'm also getting a 1280x1280 image, so not my final goal
The command I used was the following:

Code: Select all

magick convert C:\Users\gm\Desktop\Vader.jpg -resize 1280x1920^ -gravity center -crop 1280x1920+0+0 +repage C:\Users\gm\Desktop\Vader.jpg
by GoncaloM
2019-05-25T06:48:58-07:00
Forum: Magick.NET
Topic: How to get the dominant color in an image?
Replies: 4
Views: 87198

Re: How to get the dominant color in an image?

Hello everyone. I was able to implement it so here's the code if someone else needs to perform this action. using (MagickImage image = new MagickImage(ssimageBinary)) { Dictionary<MagickColor, int> dict = image.Histogram(); var keyOfMaxValue = dict.Aggregate((x, y) => x.Value > y.Value ? x : y).Key ...
by GoncaloM
2019-05-25T06:05:57-07:00
Forum: Magick.NET
Topic: How to fit image sizes correctly
Replies: 15
Views: 161373

Re: How to fit image sizes correctly

Both approaches will create the exact size you specify in the resize. Is that not what you want. If you specify 1280x1920 both approaches will make an image of 1280x1920 no matter what the input dimensions are. Is that not what you want? If not that, then what do you expect for the output size ...
by GoncaloM
2019-05-25T06:03:32-07:00
Forum: Magick.NET
Topic: How to get the dominant color in an image?
Replies: 4
Views: 87198

Re: How to get the dominant color in an image?

snibgo wrote: 2019-05-24T16:14:26-07:00 What do you mean by "dominant colour"? Perhaps you can link to sample images and tell us what the dominant colour is.
Hello.

The dominant colour is the colour that appears more times on an image, just like fmw42 shown.
I just wanted to know how to do it using Magick.NET.
by GoncaloM
2019-05-24T14:58:38-07:00
Forum: Magick.NET
Topic: How to get the dominant color in an image?
Replies: 4
Views: 87198

How to get the dominant color in an image?

Hello.
I'm trying to get the dominant colour (hexa code) in an image using the Magick.NET.
How can I do this?
by GoncaloM
2019-05-24T13:54:32-07:00
Forum: Magick.NET
Topic: How to fit image sizes correctly
Replies: 15
Views: 161373

Re: How to fit image sizes correctly

convert YourFather.jpg -resize 240x360^ -gravity center -crop 240x360+0+0 +repage YourFather2.jpg http://www.fmwconcepts.com/misc_tests/resize/YourFather2.jpg Note the ^ on the resize dimension in method 2). See https://imagemagick.org/script/command-line-processing.php#geometry This second ...
by GoncaloM
2019-05-24T00:59:08-07:00
Forum: Magick.NET
Topic: How to fit image sizes correctly
Replies: 15
Views: 161373

Re: How to fit image sizes correctly

Hi fmw42.
First of all, thank you for your answer.
I'll try to map those operations into Magick.NET and if I'm able to do it I'll post the result in here.
Cheers