I am using Magick.net to make some changes on user pictures. To Cut out a specific part of the picture I used composite with the compositoperator.Copyopacity it have been working perfectly. Then I upgrade to version 7 and now I have to user other compositoperators I found that the DstIn is something like copyOpacity and is doing my job. But the problem is that when I apply that command the pixels that are in the mask picture (the auxiliary picture which is black with some transparent area, the transparent are the area that I wanted to cut out) and are not 100% black transfers to the final picture so I have a gray and ghostly lines on the final picture. I thought maybe I have to edit the mask picture and remove all the pixels that are not 100 percent black but the problem is that I have to resize the mask in relation to the user uploaded files.
my questions :
How can cut out a part of the user picture and have a picture as my result that has the cut out part and the rest is transparent ?
the technology and framework that I am using: .Net Mvc c# and Magick.net version 7
After lots of researches I found the solution. In Image Magick 7 you do not have copyopacity composite operator but you have copyAlpha. In this approach you can have an auxilary image that is all black with some white shapes (these white shapes are the parts that you want to cut out from the user image) then you have just to composite user image with this auxiliary image with the CopyAplpha composite operator.
Related
I've an image like the one in the following link
https://www.freecodecamp.org/news/how-to-center-an-image-using-text-align/
I want to cut and move one half of the image close to the other (one building close to the other in the example image share above). In real case, I have a similar image with white space in between. To cut one part of an image I do Object-> Clip -> Set on the selection. This crops the selection alone. But I am not sure how to select and move the selection.
Could someone please help?
Duplicate the image, then clip both images to the two parts that you need. Then use snapping to move them both together exactly.
Or (better), use a raster graphics editing tool of your choice and do the same. While the above-described workflow works, Inkscape, being a vector graphics editor, is not the appropriate tool for this kind of thing.
I am using aplypy to create an RGB image of the Eagle nebula from three FITS files, representing the red, green and blue components of the image. The FITS files are available here, 673nm being the red, 656nm the green and 502nm the blue.
import aplpy
aplpy.make_rgb_cube(['673nmos.fits','656nmos.fits','502nmos.fits'], 'nmod_cube.fits')
aplpy.make_rgb_image('nmod_cube.fits','nmod.png')
f = aplpy.FITSFigure('../data/nmod_cube_2d.fits')
f.show_rgb('../data/output/nmod.png')
The image should look something like this, but comes out looking like the image below. The blue component is clearly misaligned with the red and green.
make_rgb_cube is supposed to realign the three images in to the same projection based on the WCS information in each FITS header, according to the docs, but it doesn't seem to be working in this case.
Do I need to employ a star matching library to get the alignment accuracy?
There is an error in the WCS coordinates in the header of the Blue FITS file. I have contacted spacetelescope.org to alert them.
Another example from the site, of M17, is created correctly using the aplpy script shown in the question. Blinking through each filter using DS9, as suggested in the comments, confirms the correct alignment.
Use the STScI software TweakReg to align the images and get a good alignment before combining. More information and worked examples can be found on the DrizzlePac website.
TweakReg:
Combining images using astrodrizzle requires that the WCS information in the headers of each input image align to within sub-pixel accuracy. The tweakreg task allows the user to align sets of images to each other and/or to and external astrometric reference frame or image.
It is optimized for use with HST instruments, but can be adapted for other observatories/instruments.
I'm looking to try and detect what proportion of an image is white using GraphicsMagick.
The reasoning behind this is I need to provide feedback to a user, saying that they should upload an image with a transparent background when the background is white, rather than upload an image with a pure white background.
I've looked through the documentation but I'm not quite sure where to start on this one.
Thanks
I have two ImageView(s) (let's name them, A and B) that are perfectly overlayed in the xml layout.
B has transparent background.
In my activity I firstly display on A a Bitmap with opaque colours.
Then, I display on B a transparent Bitmap (afterwards, it is planned to draw something on it trhough a canvas).
As a result of this, I get a totally black view.
I would like to be able to see the first Bitmap that I displayed on A.
What am I doing wrong? How can I achieve this?
Thanks
If you're planning on drawing something over it via a canvas, i would suggest you write a custom view class.
I have previously created an app in which i had a background-image, and on top of that the user was able to draw. I did this by building up a custom view class that extended SurfaceView.
I'm looking to see if this is possible and if so how to do it. I want the user to upload an image with a white background. The image can be anything from a pair of shoes to a hat. The website will then automatically turn that white background transparent then store it. What I want to know is there a way using HTML Canvas/CSS to transform that white background to 100% transparency?
You can have a look at this answer, which explains nicely how to change colors in an image using javascript : How to change color of an image using jquery
However, you should do this using server side code, and be aware that results may vary, as just removing a color will not look nice on the edges of your object.