Search found 18 matches

by Ash7890
2020-04-08T22:23:45-07:00
Forum: Users
Topic: Change single color to another in image
Replies: 6
Views: 1732

Re: Change single color to another in image

Thank you snibgo. It is working! The image lost transparency after your code, so I put the transparent command at last. Here is my final code(I'm using Ubuntu): // Convert raw to png magick -size 512x512 -depth 16 gray:my.raw -evaluate AddModulus 50% -auto-level +level 30720x34391 my.png // Make mar...
by Ash7890
2020-04-08T00:12:33-07:00
Forum: Users
Topic: Change single color to another in image
Replies: 6
Views: 1732

Re: Change single color to another in image

IM version is 7.0.9-27. I added "-colorspace sRGB" still no difference. I think I should explain the details of process. Firstly, I have a raw data (my.raw) here: https://drive.google.com/file/d/1QpHxuQIGTeGTgQrWWUX8nsLE9EWZqNSx/view?usp=sharing The result I want is a transparent background with blu...
by Ash7890
2020-04-07T05:30:39-07:00
Forum: Users
Topic: Change single color to another in image
Replies: 6
Views: 1732

Re: Change single color to another in image

Thank you for the reply.
It generates a gray image. I want to keep it transparent.

I tried with alpha like below however it seems the image did not change:

Code: Select all

convert alhpa.png -fill "rgba(0,0,255,255)" -opaque "rgba(134,134,134,255)" result.png
by Ash7890
2020-04-06T22:20:16-07:00
Forum: Users
Topic: Change single color to another in image
Replies: 6
Views: 1732

Change single color to another in image

I have an image (alpha.png): https://drive.google.com/file/d/1yTBRhzMldOi4n0hWEXivEawPE8DBi9Mf/view?usp=sharing As you can see, there are small dots in the image. I believe they are R135 G135 B135. I need to covert them to blue (0,0,255). Could somebody tell me how to do it please? Below is the comm...
by Ash7890
2020-03-05T06:32:14-07:00
Forum: Users
Topic: How to convert 16bit signed, little endian RAW to PNG
Replies: 27
Views: 5287

Re: How to convert 16bit signed, little endian RAW to PNG

I found the answer:

Code: Select all

head --bytes 524288 original.raw | convert -size 512x512 -depth 16 gray:- -evaluate AddModulus 50% -auto-level +level 30720x34391 result.png
by Ash7890
2020-03-05T04:49:16-07:00
Forum: Users
Topic: How to convert 16bit signed, little endian RAW to PNG
Replies: 27
Views: 5287

Re: How to convert 16bit signed, little endian RAW to PNG

Not sure if this question should be posted to a new thread... I now want to combine "head" command and "convert" command, so I do not need to create a intermediate file. I researched a bit and found miff and mpr. However, as head is not IM command, it is not the case unfortunately. It would take age...
by Ash7890
2020-03-04T22:40:30-07:00
Forum: Users
Topic: How to convert 16bit signed, little endian RAW to PNG
Replies: 27
Views: 5287

Re: How to convert 16bit signed, little endian RAW to PNG

I opened firstimage.raw in ImageJ and saved as PNG. Then opened PNG in ImageJ.
It says "Display range: 30720 - 34391". Looks OK to me.
by Ash7890
2020-03-04T22:15:13-07:00
Forum: Users
Topic: How to convert 16bit signed, little endian RAW to PNG
Replies: 27
Views: 5287

Re: How to convert 16bit signed, little endian RAW to PNG

Thanks a lot fmw42!
It is now "Display range: 30720 - 34391" on ImageJ and I think that is what my client wants.
The range is same as the one generated from ImageJ.

Hope my client is happy with the result this time!
by Ash7890
2020-03-04T21:00:41-07:00
Forum: Users
Topic: How to convert 16bit signed, little endian RAW to PNG
Replies: 27
Views: 5287

Re: How to convert 16bit signed, little endian RAW to PNG

Another problem:( I showed the png image to my client. He said that the display range is wrong. Display range of original.raw and firstimage.raw is "-2048 - 1623". I can see it in image info on ImageJ. However, the display range of png from IM is "0 - 65535". If I convert original.raw to png with Im...
by Ash7890
2020-03-04T19:42:41-07:00
Forum: Users
Topic: How to convert 16bit signed, little endian RAW to PNG
Replies: 27
Views: 5287

Re: How to convert 16bit signed, little endian RAW to PNG

"-define quantum:format=signed" is not working for me somehow.
I'm usign ImageMagick 6.7.8-9 btw.
The image won't be correct unless I add "-evaluate AddModulus 50%".
by Ash7890
2020-03-04T08:24:21-07:00
Forum: Users
Topic: How to convert 16bit signed, little endian RAW to PNG
Replies: 27
Views: 5287

Re: How to convert 16bit signed, little endian RAW to PNG

OOooo! Finally!! This is the one I wanted!
snibgo and magick, thank you soo much!
I spent 2 days to resolve this issue. Cannot thank you enough!
by Ash7890
2020-03-04T06:14:04-07:00
Forum: Users
Topic: How to convert 16bit signed, little endian RAW to PNG
Replies: 27
Views: 5287

Re: How to convert 16bit signed, little endian RAW to PNG

Mmm it still looks different. I tried both result.raw and firstimage.raw (which is made from "head" command). Both look the same. https://drive.google.com/file/d/1YaGmIIbbDF08VQ7ZzfFjKhsT04drBvHv/view?usp=sharing If you actually tried that command and it worked, then the problem might be my environm...
by Ash7890
2020-03-04T03:48:36-07:00
Forum: Users
Topic: How to convert 16bit signed, little endian RAW to PNG
Replies: 27
Views: 5287

Re: How to convert 16bit signed, little endian RAW to PNG

Yes, original.raw is large. Here is firstimage.raw generated from "head":

https://drive.google.com/file/d/1CmKPdw ... sp=sharing
by Ash7890
2020-03-03T22:36:30-07:00
Forum: Users
Topic: How to convert 16bit signed, little endian RAW to PNG
Replies: 27
Views: 5287

Re: How to convert 16bit signed, little endian RAW to PNG

I am confused "My client told me the RAW is 1ch(mono)". If there is only one channel, it is "gray:" not "uyvy:". I thought the same, and tried prefix "gray", however I got an error: convert -size 512x512 -depth 16 gray:original.raw result.raw convert: UnableToAcquireString `Cannot allocate memory' ...
by Ash7890
2020-03-03T21:17:20-07:00
Forum: Users
Topic: How to convert 16bit signed, little endian RAW to PNG
Replies: 27
Views: 5287

Re: How to convert 16bit signed, little endian RAW to PNG

I think it is not corrupted as it can be opened with ImageJ without any error and it looks correct.