-
-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to create new image with specific channels #1585
Comments
Can you prove a bit more detail on what kind of issue you are trying to solve? Because when I read #1584 it looks like you want to clone part of the image? You can use |
Hi @dlemstra, Thanks for that... yes Clone(geo) will probably cover it for me for the moment. Just for background though... I'm mostly working with large archive .tif files of photographic negative scans. These have RGB or grayscale channels + a meta0 channel used for the infrared channel from the scanner. There are a couple of scenarios where I'd like to explicitly create a .tif file with that additional IR channel added and or removed and I couldn't find how to do this with the API. eg: If I need to create a greyscale image with IR channel how would I do that? Not super important and if/when I get to needing that I can just create some template .tif files and clone from there I guess. Brad |
Not sure how this should be added to the api. Hoping someone will come and suggest how we should add this to the api. Then I can try to figure out how this can be done with the ImageMagick api. |
How about:
|
That would work for the creation but not the removal of a channel. And that also would not copy the settings of another image. And that would also not adress your removal of channels request. |
Hrm, not sure then. Perhaps:
|
There is an api in ImageMagick that can be used to set the number of meta channels. The rest of the channels have a lot of logic depending on the type/colorspace of the image. I can add a method somewhere that allows you to change the number of meta channels. Would that work for you? |
Yes, that would probably cover it - I only ever deal with one meta channel and I just need to be able to add it/remove it. |
Is your feature request related to a problem? Please describe
Need a way to create a .tiff image with channels RGB + meta0 (not alpha)
Describe the solution you'd like
A way to create a new image with a specified size and channel set.
Describe alternatives you've considered
Can't find an API method to do so, so haven't really tried anything else.
Additional context
It seems the only way to create a new image of specified size is with
public MagickImage(IMagickColor<QuantumType> color, int width, int height)
which allows some selection of channels depending on the color object passed (3 vs 4 channel) but if there's a way to create other channel formats I can't figure it out.(Ideally what I'd like is a way to create a new image of specified size with exact same settings as another image instance. I asked about this in github discussion question (#1584), but didn't get an answer. At the time I worked around it with different color objects + calling .Grayscale() to get a single channel file. But now I need RGB+meta0).
The text was updated successfully, but these errors were encountered: