Awesome! I'll give it a try. Thanks.
↧
New Post: Best approach to create PDF -> PNG thumbnails on an Azure Web Site?
↧
New Post: Performance Issues - taking to much time to convert images
It is not that strange that it is using 100% of your CPU. The resize actions are CPU intensive and Magick.NET uses as much processor power as it can get.
The next version of Magick.NET will include OpenCL support. This will move certain operations to the GPU instead of the CPU. But if your graphics card is not fast enough the CPU will be used. The first time your start Magick.NET with OpenCL it will measure the performance of your videocard and your CPU and decide which one is better. Adding a good video card or APU to your system might improve the performance.
The next version of Magick.NET will include OpenCL support. This will move certain operations to the GPU instead of the CPU. But if your graphics card is not fast enough the CPU will be used. The first time your start Magick.NET with OpenCL it will measure the performance of your videocard and your CPU and decide which one is better. Adding a good video card or APU to your system might improve the performance.
↧
↧
New Post: Convert PDF httpPostedFile to JPG Base64 AND save JPG on disk
On the same page, I need to convert the PDF to Base64 JPG AND save the JPG to disk
Code to convert to Base64 which works fine.
The code below gives me the error message:
Code to convert to Base64 which works fine.
Using image As New MagickImage(file.InputStream)
Using ms As New MemoryStream()
image.Format = MagickFormat.Jpeg
image.Density = 400
image.Write(ms)
imgString = ImageToBase64(Drawing.Image.FromStream(ms), System.Drawing.Imaging.ImageFormat.Jpeg)
End Using
End Using
Convert same PDF httpPostedFile to a JPG and save on disk - NOT WORKING.The code below gives me the error message:
An exception of type 'ImageMagick.MagickMissingDelegateErrorException' occurred in Magick.NET-x86.dll but was not handled in user code
Additional information: Magick: no decode delegate for this image format `' @ error/blob.c/BlobToImage/359
Using image1 As New MagickImage(file.InputStream)
image1.Format = MagickFormat.Jpeg
image1.Density = 400
image1.Write(Server.MapPath("Scan/") & folderName & "/" & fileRecNumber & "_" & fileMonth & "_" & fileYear & "_" & imgId & ".jpg")
End Using
↧
New Post: Performance Issues - taking to much time to convert images
Oks! So I think a solution will be to add more CPU to our photoconverter server.
Thanks, you very much. I will be waiting anxious the new version with OpenCL. :D
Thanks, you very much. I will be waiting anxious the new version with OpenCL. :D
↧
New Post: Convert PDF httpPostedFile to JPG Base64 AND save JPG on disk
I cannot explain why your second example is not working. I made a fix in ImageMagick to print a better error message. You should try again after the next release that will be published this week.
You can also rewrite your first example. MagickImage contains a method called ToBase64 and you should set the Density before loading your image:
You can also rewrite your first example. MagickImage contains a method called ToBase64 and you should set the Density before loading your image:
MagickReadSettings settings = new MagickReadSettings(); settings.Density = new MagickGeometry(400, 400); using(MagickImage image = new MagickImage(file.InputStream, settings) { image.Format = MagickFormat.Jpeg; imgString = image.ToBase64(); }
↧
↧
New Post: CMYK to RGB for JPEG
I have looked at several threads here regarding CMYK to RGB conversion. I've also modeled my code after the samples. Neither of these routines places an icc profile in the jpeg file. I'm using version 6.8.8.901 x86.
Thanks,
Darren
//Attempt 1
using (MagickImage image = new MagickImage(args[0]))
{
image.AddProfile(ColorProfile.SRGB);
image.ColorSpace = ColorSpace.sRGB;
image.Write("cmyk1.jpg");
}
//Attempt 2
using (MagickImage image = new MagickImage(args[0]))
{
image.AddProfile(new ColorProfile("sRGB_v4_ICC_preference.icc"));
image.ColorSpace = ColorSpace.sRGB;
image.Write("cmyk2.jpg");
}
Please help me understand what I'm doing wrong.Thanks,
Darren
↧
New Post: CMYK to RGB for JPEG
Do you want to perform a CMYK to RGB conversion or do you want to add your profile to the output image? Does your source image contain a color profile? Can you add a link to your input image?
↧
New Post: CMYK to RGB for JPEG
I want to convert CMYK to RGB and embed an icc profile so the colors match. I don't believe my source image has a color profile. Here's the direct link https://www.dropbox.com/s/1xrowit0719d47g/00000011.jpg
This is what identify.exe returns on it.
Darren
This is what identify.exe returns on it.
D:\Apps\ImageMagick-6.8.8-Q16>identify -verbose 00000003.jpg
Image: 00000003.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Mime type: image/jpeg
Class: DirectClass
Geometry: 675x286+0+0
Resolution: 179x179
Print size: 3.77095x1.59777
Units: PixelsPerInch
Type: ColorSeparation
Endianess: Undefined
Colorspace: CMYK
Depth: 8-bit
Channel depth:
cyan: 8-bit
magenta: 8-bit
yellow: 8-bit
black: 8-bit
Channel statistics:
Cyan:
min: 0 (0)
max: 255 (1)
mean: 44.982 (0.1764)
standard deviation: 54.7177 (0.214579)
kurtosis: 1.22171
skewness: 1.306
Magenta:
min: 0 (0)
max: 255 (1)
mean: 63.3404 (0.248394)
standard deviation: 73.9775 (0.290108)
kurtosis: 0.786581
skewness: 1.296
Yellow:
min: 0 (0)
max: 255 (1)
mean: 57.5256 (0.22559)
standard deviation: 77.7452 (0.304883)
kurtosis: 0.980444
skewness: 1.50539
Black:
min: 0 (0)
max: 255 (1)
mean: 26.7778 (0.105011)
standard deviation: 58.3135 (0.22868)
kurtosis: 7.24378
skewness: 2.83538
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 48.1564 (0.188849)
standard deviation: 66.9169 (0.262419)
kurtosis: 2.52627
skewness: 1.81497
Total ink density: 330.98%
Rendering intent: Perceptual
Gamma: 0.454545
Chromaticity:
red primary: (0.64,0.33)
green primary: (0.3,0.6)
blue primary: (0.15,0.06)
white point: (0.3127,0.329)
Background color: cmyk(255,255,255,0)
Border color: cmyk(223,223,223,0)
Matte color: cmyk(189,189,189,0)
Transparent color: cmyk(0,0,0,0)
Interlace: JPEG
Intensity: Undefined
Compose: Over
Page geometry: 675x286+0+0
Dispose: Undefined
Iterations: 0
Compression: JPEG
Quality: 93
Orientation: TopLeft
Properties:
date:create: 2014-04-09T13:15:52-05:00
date:modify: 2014-04-02T16:06:23-05:00
exif:BitsPerSample: 8, 8, 8, 8
exif:ColorSpace: 65535
exif:Compression: 6
exif:DateTime: 2014:03:24 14:37:47
exif:ExifImageLength: 286
exif:ExifImageWidth: 675
exif:ExifOffset: 232
exif:ExifVersion: 48, 50, 50, 49
exif:ImageLength: 1074
exif:ImageWidth: 2531
exif:JPEGInterchangeFormat: 382
exif:JPEGInterchangeFormatLength: 5027
exif:Orientation: 1
exif:PhotometricInterpretation: 5
exif:ResolutionUnit: 2
exif:SamplesPerPixel: 4
exif:Software: Adobe Photoshop CS6 (Windows)
exif:XResolution: 1790000/10000
exif:YResolution: 1790000/10000
jpeg:colorspace: 4
jpeg:sampling-factor: 1x1,1x1,1x1,1x1
signature: 2c16abe5ce37547da68a619f286b31eb4e186c1cff36ec35e5369918e11d374b
Profiles:
Profile-8bim: 7494 bytes
Profile-exif: 5415 bytes
Profile-iptc: 15 bytes
City[1,90]: 0x00000000: 254700 -%
unknown[2,0]:
Profile-xmp: 3222 bytes
Artifacts:
filename: 00000003.jpg
verbose: true
Tainted: False
Filesize: 125KB
Number pixels: 193K
Pixels per second: 32.18MB
User time: 0.016u
Elapsed time: 0:01.005
Version: ImageMagick 6.8.8-10 Q16 x64 2014-03-25 http://www.imagemagick.org
Thanks,Darren
↧
New Post: CMYK to RGB for JPEG
There will be no color conversion if the original image does not contain an image profile. I have updated the documentation to explain this better. You should do the following:
using (MagickImage image = new MagickImage("meat.jpg")) { image.AddProfile(ColorProfile.USWebCoatedSWOP); // Or another CMYK profile image.AddProfile(ColorProfile.SRGB); image.ColorSpace = ColorSpace.sRGB; image.Write("meat.rgb.jpg"); }
↧
↧
New Post: Convert a pdf page to image
Yes, you can find source code on this post. Good luck.
http://stackoverflow.com/questions/4809314/issues-on-imagemagick-for-converting-pdf-to-image
http://stackoverflow.com/questions/4809314/issues-on-imagemagick-for-converting-pdf-to-image
↧
New Post: CMYK to RGB for JPEG
Thanks Dirk. I will try that to see if it works. It's just a bit confusing because ImageMagick/GraphicsMagick doesn't require an image to have a profile to correct the color using the convert command. I just do convert <file.jpg> -profile sRGB.icc <outfile.jpg> and it produces the expected result. Maybe under the hood convert.exe is doing what you propose.
Thanks,
Darren
Thanks,
Darren
↧
New Post: CMYK to RGB for JPEG
The colors are closer but they do not match the original. I assume that's because it's mapping USWebCoatedSWOP to SRGB. I'm not sure what convert.exe is doing it but it is working perfectly. Is it possible to have an implementation in your code that works like convert.exe?
↧
New Post: CMYK to RGB for JPEG
Can you also add a link to the result you are getting from convert? I am not getting the correct result on the command line when I don't specify the CMYK profile.
↧
↧
New Post: CMYK to RGB for JPEG
Input File https://www.dropbox.com/s/96ek76b1nafv7as/00000003.jpg
Output File https://www.dropbox.com/s/ykn0uc0qmh0n2bk/i.jpg
sRGB.icc used https://www.dropbox.com/s/sfem5bqehu8l2ic/sRGB.icc
sRGB v4 https://www.dropbox.com/s/wxpagxabv9cbuy5/sRGB_v4_ICC_preference.icc
Command Line gm convert 00000003.jpg -profile sRGB.icc i.jpg
Thanks,
Darren
Output File https://www.dropbox.com/s/ykn0uc0qmh0n2bk/i.jpg
sRGB.icc used https://www.dropbox.com/s/sfem5bqehu8l2ic/sRGB.icc
sRGB v4 https://www.dropbox.com/s/wxpagxabv9cbuy5/sRGB_v4_ICC_preference.icc
Command Line gm convert 00000003.jpg -profile sRGB.icc i.jpg
Thanks,
Darren
↧
New Post: Convert PDF httpPostedFile to JPG Base64 AND save JPG on disk
I'll try today....
Thanks you your help.
Thanks you your help.
↧
New Post: CMYK to RGB for JPEG
ImageMagick and GraphicsMagick produce different results so you should really use convert instead of gm.
Your output image is still CMYK and the colors are negated in Windows photo viewer:
Your output image is still CMYK and the colors are negated in Windows photo viewer:
C:\Test\jpg>identify i.jpg
i.jpg JPEG 675x286 675x286+0+0 8-bit CMYK 185KB 0.000u 0:00.003
↧
New Post: CMYK to RGB for JPEG
My mistake. GM converts it properly, IM does not as you have shown however the colors are fine when opened with a program that respects the color profile such as Windows Paint in Windows 8.1. I guess I'm stuck now that IM doesn't translate the colors properly and IM.Net works just like IM. Thanks for your help. Sorry for the run-around.
BTW - Below is GM's convert, which is the image linked a couple threads above.
BTW - Below is GM's convert, which is the image linked a couple threads above.
D:\Apps\GraphicsMagick-1.3.19-Q16>gm identify -verbose i3.jpg
Image: i3.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Geometry: 675x286
Class: DirectClass
Type: true color
Depth: 8 bits-per-pixel component
Channel Depths:
Red: 8 bits
Green: 8 bits
Blue: 8 bits
Channel Statistics:
Red:
Minimum: 0.00 (0.0000)
Maximum: 65535.00 (1.0000)
Mean: 47978.79 (0.7321)
Standard Deviation: 18462.24 (0.2817)
Green:
Minimum: 0.00 (0.0000)
Maximum: 65535.00 (1.0000)
Mean: 43794.90 (0.6683)
Standard Deviation: 21085.24 (0.3217)
Blue:
Minimum: 0.00 (0.0000)
Maximum: 65535.00 (1.0000)
Mean: 45090.56 (0.6880)
Standard Deviation: 21685.88 (0.3309)
Resolution: 72x72 pixels/inch
Filesize: 54.8K
Interlace: No
Orientation: TopLeft
Background Color: white
Border Color: #DFDFDF
Matte Color: #BDBDBD
Page geometry: 675x286+0+0
Compose: Over
Dispose: Undefined
Iterations: 0
Compression: JPEG
JPEG-Quality: 75
JPEG-Colorspace: 2
JPEG-Colorspace-Name: RGB
JPEG-Sampling-factors: 2x2,1x1,1x1
Signature: 2c6e584c92d1a9fa4fa30b814624500c27f9e89258db86a1ba50930aa9d0b75c
Profile-iptc: 7494 bytes
City:
0x00000000: 254700 -%
unknown:
unknown:
_`áÅA?,aÿ
Profile-EXIF: 5415 bytes
Image Width: 2531
Image Length: 1074
Bits Per Sample: 8
Photometric Interpretation: 5
Orientation: 1
Samples Per Pixel: 4
X Resolution: 1790000/10000
Y Resolution: 1790000/10000
Resolution Unit: 2
Software: Adobe Photoshop CS6 (Windows)
Date Time: 2014:03:24 14:37:47
Exif Offset: 232
Exif Version: 0221
Color Space: 65535
Exif Image Width: 675
Exif Image Length: 286
Profile-XMP: 3222 bytes
Tainted: False
↧
↧
New Post: How to resize PDF converted to JPEG
I need to resize an PDF converted to a JPEG which is converted to a Base64 using the method ToBase64()
I tried the following but didn't work
Thanks
I tried the following but didn't work
Dim settings As New MagickReadSettings()
settings.Density = New MagickGeometry(400, 400)
settings.Width = 800
settings.Height = 600
Using image As New MagickImage(file.InputStream, settings)
image.Format = MagickFormat.Jpeg
imgString = image.ToBase64()
image.Write(Server.MapPath("../Scan/") & imgString)
End Using
The image is being saved but not in the correct sizeThanks
↧
New Post: How to resize PDF converted to JPEG
Specifying the size of the image in MagickReadSettings does not automatically resize it. It is a setting for images that don't have predefined dimensions. You will have to call the Resize method.
image.Format = MagickFormat.Jpeg image.Resize(800, 600) imgString = image.ToBase64()
↧
New Post: CMYK to RGB for JPEG
Can you add a link to your GM output image? It is strange that identify does not report an embedded icc profile.
↧