How to use Imagick to Crop Image Top , Bottom , Center - imagick

cropThumbnailImage($maxWidth,$maxHeight);
I created a php code to crop image on the fly using Imagick with class cropThumbnailImage($maxWidth,$maxHeight); . But this class crops image at center . Is there any other way to crop image the required position like top , bottom .

Related

Flutter use InteractiveViewer to crop an image

I'd like to use InteractiveViewer in order to implement my own image crop.
Steps:
The user pans and scales an image, using InteractiveViewer
The user clicks a button
Get the "viewable" part of the InteractiveViewer content (bounding box)
Using this library, crop the image
Resize the cropped image (scale down), maybe compress it, and upload to my server
I fail to understand step 3: getting the "viewable" part of the InteractiveViewer content

How to extract on-screen area on XD of an image

I just received the XD file from the designer, now am trying to extract the nav area image from the canvas but image is too spread out from the canvas how it can be cropped to the area of the nav.
Use Adobe Photoshop To Resize them to Fit Original image
or
if you want part of image you can use one of image magnify plugins first
they will fit image to canvas
then use export
Also you can use Web Export Plugins

Photo with landscape orientation like first in the gallery

My users can add photos to their gallery. I want that like a first will display photo with landscape orientation or the widest (it will be better). I don't care about sort. I wrote only about first photo in gallery.
try intervention/image package
for orientation use this code
// import the Intervention Image Manager Class
use Intervention\Image\ImageManagerStatic as Image;
$img = Image::make('foo.jpg')->orientate();

need to add text on overlay image in fabric js

i have added overlay image in fabric js . But need to add text on this overlay
image in canvas. it is made in fabric.js. how to do that?
I guess you are trying to bring text layer on top of image layer. Like z- index in css.
You need to set sendtoBack for image. Then text layer will be in front.
canvas.sendToBack(img);

java & SWT - how to use masking on images

i'm trying to use masking on an image in order to set a part of the image to be transparent.
from what i've read , it's supported by the SWT library , but i can't find a way to do it . i can't find even an example for that .
i've therefore created my own way to do it , by implementing the masking part :
first i find an RGB value that isn't taken anywhere on the image , and then i set it to be the transparency color. then i take the masking image , and use it to put the correct pixel (either transparent or taken from the source image) in order to create a new image.
it works , but i wish i had a simpler method .
can anyone please help?
This constructor on the Image class looks to do the job:
public Image(Device device,
ImageData source,
ImageData mask)
from the javadoc...
Constructs an instance of this class, whose type is SWT.ICON, from the two given ImageData objects. The two images must be the same size. Pixel transparency in either image will be ignored.
The mask image should contain white wherever the icon is to be visible, and black wherever the icon is to be transparent. In addition, the source image should contain black wherever the icon is to be transparent.
Parameters:
device - the device on which to create the icon
source - the color data for the icon
mask - the mask data for the icon

Resources