We present a new method, which we call design-by-morphing, for the optimal design of the shape of an object. Traditional morphing methods, which require covering the surface of an object with a large number (typically millions) of triangular meshed points, cannot be used in searches for optimal designs because traditional morphing methods break down without human intervention. With our new methodology, the surfaces of one or more objects (or the sub-objects from which they are composed) are represented as truncated series of exponentially-convergent spectral basis functions multiplied by spectral coefficients. A morphed object (or sub-object) is obtained from a new set of spectral coefficients, which are a weighted average of the spectral coefficients of the original objects (or sub-objects) from which it is morphed. Optimized designs, say, for reducing aerodynamic drag, are created by choosing the weights such that a cost function of the new morphed shape is minimized. Re-purposing the applied mathematics that were developed for spectral methods in computational fluid dynamics, the boundaries of an object and the interfaces between sub-objects can be forced to satisfy constraints on their shapes, slopes, curvature, etc. With these constraints, sub-objects can be seamlessly attached to each other to create a complex object. Our design-by-morphing method can be automated and is computationally efficient, so it requires much less human input than traditional design methods and is therefore not only inexpensive but also free from human bias in finding optimal designs that are radical and non-intuitive. Examples are presented of optimal designs of trains, airplanes, and turbine draft tubes. The efficiencies of the designs are improved by more than 10%.